Ignore:
Timestamp:
May 24, 2015, 8:51:17 PM (10 years ago)
Author:
[email protected]
Message:

Array#findIndex/find should not skip holes
https://bugs.webkit.org/show_bug.cgi?id=145361
Source/JavaScriptCore:

per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.findindex
and https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.find

Patch by Jordan Harband <[email protected]> on 2015-05-24
Reviewed by Yusuke Suzuki.

  • builtins/Array.prototype.js:

(find): Deleted.
(findIndex): Deleted.

LayoutTests:

Patch by Jordan Harband <[email protected]> on 2015-05-24
Reviewed by Yusuke Suzuki.

  • js/array-find-expected.txt:
  • js/array-findIndex-expected.txt:
  • js/script-tests/array-find.js:
  • js/script-tests/array-findIndex.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/builtins/Array.prototype.js

    r184582 r184848  
    209209    var thisArg = arguments.length > 1 ? arguments[1] : undefined;
    210210    for (var i = 0; i < length; i++) {
    211         if (!(i in array))
    212             continue;
    213211        var kValue = array[i];
    214212        if (callback.@call(thisArg, kValue, i, array))
     
    234232    var thisArg = arguments.length > 1 ? arguments[1] : undefined;
    235233    for (var i = 0; i < length; i++) {
    236         if (!(i in array))
    237             continue;
    238234        if (callback.@call(thisArg, array[i], i, array))
    239235            return i;
Note: See TracChangeset for help on using the changeset viewer.