| Summary: | Array#findIndex/find should not skip holes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jordan Harband <ljharb> | ||||
| Component: | JavaScriptCore | Assignee: | Jordan Harband <ljharb> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, fpizlo, ggaren, ysuzuki | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | 132658 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Jordan Harband
2015-05-24 12:45:52 PDT
Created attachment 253666 [details]
Patch
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 (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 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 on attachment 253666 [details] Patch Clearing flags on attachment: 253666 Committed r184848: <http://trac.webkit.org/changeset/184848> All reviewed patches have been landed. Closing bug. |