blob: 2b5f626adb75527d15597fd965e215b2ce2b0b94 [file] [log] [blame]
//@ runBigIntEnabled
function assert(a) {
if (!a)
throw new Error("Bad assertion");
}
function assertThrowTypeError(input) {
try {
let n = BigInt.prototype.valueOf(input);
assert(false);
} catch (e) {
assert(e instanceof TypeError);
}
}
assertThrowTypeError(10);
assertThrowTypeError("abc");
assertThrowTypeError(Symbol("a"));
assertThrowTypeError(10.5);
assertThrowTypeError({});