1 // Copyright (C) 2017 The V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
5 description: BigInt throws a RangeError if value is Infinity
6 esid: sec-bigint-constructor
11 2. Let prim be ? ToPrimitive(value, hint Number).
12 3. If Type(prim) is Number, return ? NumberToBigInt(prim).
15 NumberToBigInt ( number )
18 2. If IsSafeInteger(number) is false, throw a RangeError exception.
21 IsSafeInteger ( number )
24 2. If number is NaN, +∞, or -∞, return false.
28 assert.throws(RangeError, function() {
39 assert.throws(RangeError, function() {
42 assert.sameValue(calls, 1, "it fails after fetching the primitive value");