WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
145361
Array#findIndex/find should not skip holes
https://bugs.webkit.org/show_bug.cgi?id=145361
Summary
Array#findIndex/find should not skip holes
Jordan Harband
Reported
2015-05-24 12:45:52 PDT
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
, these methods should not skip holes.
Attachments
Patch
(12.87 KB, patch)
2015-05-24 13:00 PDT
,
Jordan Harband
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jordan Harband
Comment 1
2015-05-24 13:00:22 PDT
Created
attachment 253666
[details]
Patch
Yusuke Suzuki
Comment 2
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
Jordan Harband
Comment 3
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");`
Yusuke Suzuki
Comment 4
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!
WebKit Commit Bot
Comment 5
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
>
WebKit Commit Bot
Comment 6
2015-05-24 20:51:34 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug