mirror of https://github.com/tc39/test262.git
Eliminate false positives: Array.prototype.flat, Array.prototype.flatMap
This commit is contained in:
parent
d52f621aba
commit
2e18327af2
|
@ -8,6 +8,8 @@ description: >
|
|||
features: [Array.prototype.flat]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Array.prototype.flat, 'function');
|
||||
|
||||
var a = [];
|
||||
a.constructor = null;
|
||||
assert.throws(TypeError, function() {
|
||||
|
|
|
@ -7,6 +7,8 @@ description: >
|
|||
features: [Array.prototype.flat]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Array.prototype.flat, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
[].flat.call(null);
|
||||
}, 'null value');
|
||||
|
|
|
@ -7,6 +7,8 @@ description: >
|
|||
features: [Array.prototype.flat]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Array.prototype.flat, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
[].flat(Symbol());
|
||||
}, 'symbol value');
|
||||
|
|
|
@ -7,6 +7,8 @@ description: >
|
|||
features: [Array.prototype.flatMap]
|
||||
---*/
|
||||
|
||||
assert(Array.prototype.flatMap);
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
[].flatMap({});
|
||||
}, 'non callable argument');
|
||||
|
|
|
@ -8,6 +8,8 @@ description: >
|
|||
features: [Array.prototype.flatMap]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Array.prototype.flatMap, 'function');
|
||||
|
||||
var a = [];
|
||||
a.constructor = null;
|
||||
assert.throws(TypeError, function() {
|
||||
|
|
|
@ -7,6 +7,8 @@ description: >
|
|||
features: [Array.prototype.flatMap]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Array.prototype.flatMap, 'function');
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
[].flatMap.call(null);
|
||||
}, 'null value');
|
||||
|
|
|
@ -17,10 +17,12 @@ info: |
|
|||
b. Let exists be ? HasProperty(source, P).
|
||||
c. If exists is true, then
|
||||
i. Let element be ? Get(source, P).
|
||||
features: [Array.prototype.flat]
|
||||
features: [Array.prototype.flatMap]
|
||||
includes: [compareArray.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(typeof Array.prototype.flatMap, 'function');
|
||||
|
||||
const getCalls = [], hasCalls = [];
|
||||
const handler = {
|
||||
get : function (t, p, r) { getCalls.push(p); return Reflect.get(t, p, r); },
|
||||
|
|
Loading…
Reference in New Issue