mirror of https://github.com/tc39/test262.git
The Array.prototype.find function is an ES6 function.
A number of Array.prototype.find tests were missing a feature specification.
This commit is contained in:
parent
a1437652ab
commit
e108edfd92
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
description: Find on empty array should return undefined
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var a = [].find(function () {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
description: The length property of the find method is 1
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
if ([].find.length !== 1) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
description: Array may be mutated by calls to the predicate
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
[1, 2, 3].find(function (v, i, arr) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
description: Find with a predicate with no return value should return undefined
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var a = [1, 2, 3].find(function () {});
|
||||
|
|
|
@ -6,6 +6,7 @@ description: >
|
|||
Array.prototype.find should throw a TypeError if
|
||||
IsCallable(predicate) is false
|
||||
includes: [runTestCase.js]
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var uncallableValues = [
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
description: >
|
||||
predicate is called with three arguments: the value of the
|
||||
element, the index of the element, and the object being traversed.
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var a = [1];
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
description: >
|
||||
Elements added to array after find has been called should not be
|
||||
visited
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
[1].find(function (v, i, arr) {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
description: >
|
||||
Elements removed from array after find has been called should be
|
||||
visited
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var elementsVisited;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
description: Find should return value if predicate returns true
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var testVals = [
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
/*---
|
||||
description: thisArg should be bound to this if provided
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var globalThis = this;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
description: thisArg should be global object if not provided (not Strict mode)
|
||||
flags: [noStrict]
|
||||
includes: [fnGlobalObject.js]
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
/*---
|
||||
description: Array.prototype.find should convert thisArg into an object
|
||||
flags: [noStrict]
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
var dataTypes = [
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
/*---
|
||||
description: thisArg should be undefined if not provided (Strict mode)
|
||||
flags: [onlyStrict]
|
||||
features: [Array#find]
|
||||
---*/
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue