mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Add tests for calling BigInt functions with fewer arguments than required (#2075)
This commit is contained in:
parent
298ad6907b
commit
efa414ae00
@ -11,6 +11,14 @@ features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
|||||||
---*/
|
---*/
|
||||||
assert.sameValue(typeof BigInt, 'function');
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
assert.sameValue(typeof BigInt.asIntN, 'function');
|
assert.sameValue(typeof BigInt.asIntN, 'function');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function () {
|
||||||
|
BigInt.asIntN();
|
||||||
|
}, "ToBigInt: no argument => undefined => TypeError");
|
||||||
|
assert.throws(TypeError, function () {
|
||||||
|
BigInt.asIntN(0);
|
||||||
|
}, "ToBigInt: no argument => undefined => TypeError");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
BigInt.asIntN(0, undefined);
|
BigInt.asIntN(0, undefined);
|
||||||
}, "ToBigInt: undefined => TypeError");
|
}, "ToBigInt: undefined => TypeError");
|
||||||
|
@ -12,6 +12,13 @@ features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
|
|||||||
assert.sameValue(typeof BigInt, 'function');
|
assert.sameValue(typeof BigInt, 'function');
|
||||||
assert.sameValue(typeof BigInt.asUintN, 'function');
|
assert.sameValue(typeof BigInt.asUintN, 'function');
|
||||||
|
|
||||||
|
assert.throws(TypeError, function () {
|
||||||
|
BigInt.asUintN();
|
||||||
|
}, "ToBigInt: no argument => undefined => TypeError");
|
||||||
|
assert.throws(TypeError, function () {
|
||||||
|
BigInt.asUintN(0);
|
||||||
|
}, "ToBigInt: no argument => undefined => TypeError");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
BigInt.asUintN(0, undefined);
|
BigInt.asUintN(0, undefined);
|
||||||
}, "ToBigInt: undefined => TypeError");
|
}, "ToBigInt: undefined => TypeError");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user