Skip to content
Snippets Groups Projects
Commit 54de5fb5 authored by Brian Terlson's avatar Brian Terlson
Browse files

Merge pull request #319 from pvginkel/missing-features

The Array.prototype.find function is an ES6 function.
parents cd35655b e108edfd
No related branches found
No related tags found
No related merge requests found
Showing
with 13 additions and 0 deletions
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/*--- /*---
description: Find on empty array should return undefined description: Find on empty array should return undefined
features: [Array#find]
---*/ ---*/
var a = [].find(function () { var a = [].find(function () {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/*--- /*---
description: The length property of the find method is 1 description: The length property of the find method is 1
features: [Array#find]
---*/ ---*/
if ([].find.length !== 1) { if ([].find.length !== 1) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/*--- /*---
description: Array may be mutated by calls to the predicate description: Array may be mutated by calls to the predicate
features: [Array#find]
---*/ ---*/
[1, 2, 3].find(function (v, i, arr) { [1, 2, 3].find(function (v, i, arr) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/*--- /*---
description: Find with a predicate with no return value should return undefined description: Find with a predicate with no return value should return undefined
features: [Array#find]
---*/ ---*/
var a = [1, 2, 3].find(function () {}); var a = [1, 2, 3].find(function () {});
......
...@@ -6,6 +6,7 @@ description: > ...@@ -6,6 +6,7 @@ description: >
Array.prototype.find should throw a TypeError if Array.prototype.find should throw a TypeError if
IsCallable(predicate) is false IsCallable(predicate) is false
includes: [runTestCase.js] includes: [runTestCase.js]
features: [Array#find]
---*/ ---*/
var uncallableValues = [ var uncallableValues = [
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
description: > description: >
predicate is called with three arguments: the value of the predicate is called with three arguments: the value of the
element, the index of the element, and the object being traversed. element, the index of the element, and the object being traversed.
features: [Array#find]
---*/ ---*/
var a = [1]; var a = [1];
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
description: > description: >
Elements added to array after find has been called should not be Elements added to array after find has been called should not be
visited visited
features: [Array#find]
---*/ ---*/
[1].find(function (v, i, arr) { [1].find(function (v, i, arr) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
description: > description: >
Elements removed from array after find has been called should be Elements removed from array after find has been called should be
visited visited
features: [Array#find]
---*/ ---*/
var elementsVisited; var elementsVisited;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/*--- /*---
description: Find should return value if predicate returns true description: Find should return value if predicate returns true
features: [Array#find]
---*/ ---*/
var testVals = [ var testVals = [
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/*--- /*---
description: thisArg should be bound to this if provided description: thisArg should be bound to this if provided
features: [Array#find]
---*/ ---*/
var globalThis = this; var globalThis = this;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
description: thisArg should be global object if not provided (not Strict mode) description: thisArg should be global object if not provided (not Strict mode)
flags: [noStrict] flags: [noStrict]
includes: [fnGlobalObject.js] includes: [fnGlobalObject.js]
features: [Array#find]
---*/ ---*/
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/*--- /*---
description: Array.prototype.find should convert thisArg into an object description: Array.prototype.find should convert thisArg into an object
flags: [noStrict] flags: [noStrict]
features: [Array#find]
---*/ ---*/
var dataTypes = [ var dataTypes = [
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
/*--- /*---
description: thisArg should be undefined if not provided (Strict mode) description: thisArg should be undefined if not provided (Strict mode)
flags: [onlyStrict] flags: [onlyStrict]
features: [Array#find]
---*/ ---*/
......
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