Eliminate false positives: BigInt

This commit is contained in:
Rick Waldron 2018-11-30 11:34:13 -05:00
parent d98f3f4d63
commit 6e836cea56
13 changed files with 23 additions and 2 deletions

View File

@ -9,7 +9,8 @@ info: |
2. Let bigint ? ToBigInt(bigint). 2. Let bigint ? ToBigInt(bigint).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asIntN, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
BigInt.asIntN(0, undefined); BigInt.asIntN(0, undefined);
}, "ToBigInt: undefined => TypeError"); }, "ToBigInt: undefined => TypeError");

View File

@ -9,7 +9,8 @@ info: |
2. Let bigint ? ToBigInt(bigint). 2. Let bigint ? ToBigInt(bigint).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asIntN, 'function');
function err() { function err() {
throw new Test262Error(); throw new Test262Error();
} }

View File

@ -9,6 +9,8 @@ info: |
1. Let bits be ? ToIndex(bits). 1. Let bits be ? ToIndex(bits).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asIntN, 'function');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
BigInt.asIntN(-1, 0n); BigInt.asIntN(-1, 0n);

View File

@ -9,6 +9,8 @@ info: |
1. Let bits be ? ToIndex(bits). 1. Let bits be ? ToIndex(bits).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asIntN, 'function');
function err() { function err() {
throw new Test262Error(); throw new Test262Error();

View File

@ -9,6 +9,8 @@ info: |
2. Let bigint ? ToBigInt(bigint). 2. Let bigint ? ToBigInt(bigint).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asUintN, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
BigInt.asUintN(0, undefined); BigInt.asUintN(0, undefined);

View File

@ -9,6 +9,8 @@ info: |
2. Let bigint ? ToBigInt(bigint). 2. Let bigint ? ToBigInt(bigint).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asUintN, 'function');
function err() { function err() {
throw new Test262Error(); throw new Test262Error();

View File

@ -9,6 +9,8 @@ info: |
1. Let bits be ? ToIndex(bits). 1. Let bits be ? ToIndex(bits).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asUintN, 'function');
assert.throws(RangeError, function() { assert.throws(RangeError, function() {
BigInt.asUintN(-1, 0n); BigInt.asUintN(-1, 0n);

View File

@ -9,6 +9,8 @@ info: |
1. Let bits be ? ToIndex(bits). 1. Let bits be ? ToIndex(bits).
features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.sameValue(typeof BigInt.asUintN, 'function');
function err() { function err() {
throw new Test262Error(); throw new Test262Error();

View File

@ -9,6 +9,7 @@ info: |
... ...
features: [BigInt] features: [BigInt]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
new BigInt(); new BigInt();

View File

@ -15,6 +15,7 @@ info: |
[[BigIntData]] internal slot. [[BigIntData]] internal slot.
features: [BigInt] features: [BigInt]
---*/ ---*/
assert.sameValue(typeof BigInt, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
BigInt.prototype.toString(1); BigInt.prototype.toString(1);

View File

@ -21,6 +21,8 @@ features: [BigInt, Symbol, Symbol.toPrimitive]
var toString = BigInt.prototype.toString; var toString = BigInt.prototype.toString;
assert.sameValue(typeof toString, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
toString.call({ toString.call({
x: 1n x: 1n

View File

@ -20,6 +20,7 @@ features: [BigInt]
---*/ ---*/
var valueOf = BigInt.prototype.valueOf; var valueOf = BigInt.prototype.valueOf;
assert.sameValue(typeof valueOf, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
valueOf.call({}); valueOf.call({});

View File

@ -21,6 +21,8 @@ features: [BigInt, Symbol]
var valueOf = BigInt.prototype.valueOf; var valueOf = BigInt.prototype.valueOf;
assert.sameValue(typeof valueOf, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
valueOf.call(undefined); valueOf.call(undefined);
}, "undefined"); }, "undefined");