Skip to content
Snippets Groups Projects
Unverified Commit 31e654a3 authored by Leo Balter's avatar Leo Balter Committed by GitHub
Browse files

Merge pull request #1978 from tc39/eliminate-some-false-positives

Eliminate some false positives
parents 476e6877 3b09d0e2
No related branches found
No related tags found
No related merge requests found
Showing
with 38 additions and 3 deletions
...@@ -8,6 +8,8 @@ description: > ...@@ -8,6 +8,8 @@ description: >
features: [Array.prototype.flat] features: [Array.prototype.flat]
---*/ ---*/
assert.sameValue(typeof Array.prototype.flat, 'function');
var a = []; var a = [];
a.constructor = null; a.constructor = null;
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
......
...@@ -7,6 +7,8 @@ description: > ...@@ -7,6 +7,8 @@ description: >
features: [Array.prototype.flat] features: [Array.prototype.flat]
---*/ ---*/
assert.sameValue(typeof Array.prototype.flat, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
[].flat.call(null); [].flat.call(null);
}, 'null value'); }, 'null value');
......
...@@ -7,6 +7,8 @@ description: > ...@@ -7,6 +7,8 @@ description: >
features: [Array.prototype.flat] features: [Array.prototype.flat]
---*/ ---*/
assert.sameValue(typeof Array.prototype.flat, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
[].flat(Symbol()); [].flat(Symbol());
}, 'symbol value'); }, 'symbol value');
......
...@@ -7,6 +7,8 @@ description: > ...@@ -7,6 +7,8 @@ description: >
features: [Array.prototype.flatMap] features: [Array.prototype.flatMap]
---*/ ---*/
assert(Array.prototype.flatMap);
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
[].flatMap({}); [].flatMap({});
}, 'non callable argument'); }, 'non callable argument');
...@@ -8,6 +8,8 @@ description: > ...@@ -8,6 +8,8 @@ description: >
features: [Array.prototype.flatMap] features: [Array.prototype.flatMap]
---*/ ---*/
assert.sameValue(typeof Array.prototype.flatMap, 'function');
var a = []; var a = [];
a.constructor = null; a.constructor = null;
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
......
...@@ -7,6 +7,8 @@ description: > ...@@ -7,6 +7,8 @@ description: >
features: [Array.prototype.flatMap] features: [Array.prototype.flatMap]
---*/ ---*/
assert.sameValue(typeof Array.prototype.flatMap, 'function');
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
[].flatMap.call(null); [].flatMap.call(null);
}, 'null value'); }, 'null value');
......
...@@ -17,10 +17,12 @@ info: | ...@@ -17,10 +17,12 @@ info: |
b. Let exists be ? HasProperty(source, P). b. Let exists be ? HasProperty(source, P).
c. If exists is true, then c. If exists is true, then
i. Let element be ? Get(source, P). i. Let element be ? Get(source, P).
features: [Array.prototype.flat] features: [Array.prototype.flatMap]
includes: [compareArray.js] includes: [compareArray.js]
---*/ ---*/
assert.sameValue(typeof Array.prototype.flatMap, 'function');
const getCalls = [], hasCalls = []; const getCalls = [], hasCalls = [];
const handler = { const handler = {
get : function (t, p, r) { getCalls.push(p); return Reflect.get(t, p, r); }, get : function (t, p, r) { getCalls.push(p); return Reflect.get(t, p, r); },
......
...@@ -9,7 +9,8 @@ info: | ...@@ -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");
......
...@@ -9,7 +9,8 @@ info: | ...@@ -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();
} }
......
...@@ -9,6 +9,8 @@ info: | ...@@ -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);
......
...@@ -9,6 +9,8 @@ info: | ...@@ -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();
......
...@@ -9,6 +9,8 @@ info: | ...@@ -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);
......
...@@ -9,6 +9,8 @@ info: | ...@@ -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();
......
...@@ -9,6 +9,8 @@ info: | ...@@ -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);
......
...@@ -9,6 +9,8 @@ info: | ...@@ -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();
......
...@@ -9,6 +9,7 @@ info: | ...@@ -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();
......
...@@ -15,6 +15,7 @@ info: | ...@@ -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);
......
...@@ -21,6 +21,8 @@ features: [BigInt, Symbol, Symbol.toPrimitive] ...@@ -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
......
...@@ -20,6 +20,7 @@ features: [BigInt] ...@@ -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({});
......
...@@ -21,6 +21,8 @@ features: [BigInt, Symbol] ...@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment