blob: 36315c2f2bc9d3356034e3129bab3973b6513600 [file] [log] [blame]
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({});