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:
Pieter van Ginkel 2015-06-14 06:22:33 +02:00
parent a1437652ab
commit e108edfd92
13 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,7 @@
/*---
description: Find on empty array should return undefined
features: [Array#find]
---*/
var a = [].find(function () {

View File

@ -3,6 +3,7 @@
/*---
description: The length property of the find method is 1
features: [Array#find]
---*/
if ([].find.length !== 1) {

View File

@ -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) {

View File

@ -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 () {});

View File

@ -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 = [

View File

@ -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];

View File

@ -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) {

View File

@ -5,6 +5,7 @@
description: >
Elements removed from array after find has been called should be
visited
features: [Array#find]
---*/
var elementsVisited;

View File

@ -3,6 +3,7 @@
/*---
description: Find should return value if predicate returns true
features: [Array#find]
---*/
var testVals = [

View File

@ -3,6 +3,7 @@
/*---
description: thisArg should be bound to this if provided
features: [Array#find]
---*/
var globalThis = this;

View File

@ -5,6 +5,7 @@
description: thisArg should be global object if not provided (not Strict mode)
flags: [noStrict]
includes: [fnGlobalObject.js]
features: [Array#find]
---*/

View File

@ -4,6 +4,7 @@
/*---
description: Array.prototype.find should convert thisArg into an object
flags: [noStrict]
features: [Array#find]
---*/
var dataTypes = [

View File

@ -4,6 +4,7 @@
/*---
description: thisArg should be undefined if not provided (Strict mode)
flags: [onlyStrict]
features: [Array#find]
---*/