Array.prototype.find and findIndex should skip holes
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 May 2014 16:14:55 +0000 (16:14 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 May 2014 16:14:55 +0000 (16:14 +0000)
commitf972ff54489c5311ffa5594b1380f4ab9f290c53
tree545e0feb6f6aa8a70e75b3de011c47b83469f0d1
parenta3768cc186f0cc38db48edd0f28ae082ce794c6f
Array.prototype.find and findIndex should skip holes
https://bugs.webkit.org/show_bug.cgi?id=132658

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:
Skip holes in the array when iterating such that callback isn't called.

* builtins/Array.prototype.js:
(find):
(findIndex):

LayoutTests:
* js/array-find-expected.txt:
* js/array-findIndex-expected.txt:
* js/script-tests/array-find.js:
* js/script-tests/array-findIndex.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/array-find-expected.txt
LayoutTests/js/array-findIndex-expected.txt
LayoutTests/js/script-tests/array-find.js
LayoutTests/js/script-tests/array-findIndex.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/Array.prototype.js