Bug 145361 - Array#findIndex/find should not skip holes
Summary: Array#findIndex/find should not skip holes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jordan Harband
URL:
Keywords:
Depends on: 132658
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-24 12:45 PDT by Jordan Harband
Modified: 2015-05-24 20:51 PDT (History)
4 users (show)

See Also:


Attachments
Patch (12.87 KB, patch)
2015-05-24 13:00 PDT, Jordan Harband
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Jordan Harband 2015-05-24 13:00:22 PDT
Created attachment 253666 [details]
Patch
Comment 2 Yusuke Suzuki 2015-05-24 19:15:53 PDT
Comment on attachment 253666 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253666&action=review

> LayoutTests/js/script-tests/array-find.js:49
> +arrayWithHoles[7] = "";

Coulld you add non-arrayhole `undefined` case?

> LayoutTests/js/script-tests/array-findIndex.js:49
> +arrayWithHoles[7] = "";

Ditto
Comment 3 Jordan Harband 2015-05-24 19:33:18 PDT
(In reply to comment #2)
> Comment on attachment 253666 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253666&action=review
> 
> > LayoutTests/js/script-tests/array-find.js:49
> > +arrayWithHoles[7] = "";
> 
> Coulld you add non-arrayhole `undefined` case?
> 
> > LayoutTests/js/script-tests/array-findIndex.js:49
> > +arrayWithHoles[7] = "";
> 
> Ditto

Both of those already exist in the test files, higher up. `shouldBe("[undefined, 0, null, false, ''].find(passUndefined)", "undefined");` and `shouldBe("[undefined, 0, null, false, ''].findIndex(passUndefined)", "0");`
Comment 4 Yusuke Suzuki 2015-05-24 20:02:07 PDT
Comment on attachment 253666 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253666&action=review

>>> LayoutTests/js/script-tests/array-find.js:49
>>> +arrayWithHoles[7] = "";
>> 
>> Coulld you add non-arrayhole `undefined` case?
> 
> Both of those already exist in the test files, higher up. `shouldBe("[undefined, 0, null, false, ''].find(passUndefined)", "undefined");` and `shouldBe("[undefined, 0, null, false, ''].findIndex(passUndefined)", "0");`

OK, make sense. Nice catch!
Comment 5 WebKit Commit Bot 2015-05-24 20:51:31 PDT
Comment on attachment 253666 [details]
Patch

Clearing flags on attachment: 253666

Committed r184848: <http://trac.webkit.org/changeset/184848>
Comment 6 WebKit Commit Bot 2015-05-24 20:51:34 PDT
All reviewed patches have been landed.  Closing bug.