1 // Copyright (C) 2017 Caio Lima. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
5 description: Throws exception in BigIntConstructor if toString throws
6 esid: sec-bigint-constructor-number-value
8 1. If NewTarget is not undefined, throw a TypeError exception.
9 2. Let prim be ? ToPrimitive(value, hint Number).
10 3. If Type(prim) is Number, return ? NumberToBigInt(prim).
11 4. Otherwise, return ? ToBigInt(value).
15 assert.throws(Test262Error, function() {
17 toString: function() {
18 throw new Test262Error();