WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
142707
ES7: Implement Array.prototype.includes
https://bugs.webkit.org/show_bug.cgi?id=142707
Summary
ES7: Implement Array.prototype.includes
Dean Jackson
Reported
2015-03-14 21:39:10 PDT
ES7: Implement Array.prototype.includes
Attachments
Patch
(7.55 KB, patch)
2015-03-14 21:43 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews105 for mac-mavericks-wk2
(560.04 KB, application/zip)
2015-03-14 22:18 PDT
,
Build Bot
no flags
Details
Patch
(11.63 KB, patch)
2015-03-14 22:19 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(11.54 KB, patch)
2015-03-22 15:21 PDT
,
Dean Jackson
ggaren
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-03-14 21:43:02 PDT
<
rdar://problem/20165824
>
Dean Jackson
Comment 2
2015-03-14 21:43:13 PDT
Created
attachment 248667
[details]
Patch
Build Bot
Comment 3
2015-03-14 22:18:09 PDT
Comment on
attachment 248667
[details]
Patch
Attachment 248667
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/6016985234145280
New failing tests: js/Object-getOwnPropertyNames.html
Build Bot
Comment 4
2015-03-14 22:18:12 PDT
Created
attachment 248671
[details]
Archive of layout-test-results from ews105 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Dean Jackson
Comment 5
2015-03-14 22:19:53 PDT
Created
attachment 248672
[details]
Patch
Geoffrey Garen
Comment 6
2015-03-16 10:38:00 PDT
Comment on
attachment 248672
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=248672&action=review
r- because I found a missing exception check.
> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:1101 > +EncodedJSValue JSC_HOST_CALL arrayProtoFuncIncludes(ExecState* exec)
Are you scarred enough from writing of in JavaScript that you chose C++ for this? :) Seriously, though, JS might be better.
> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:1104 > + JSObject* thisObj = exec->thisValue().toThis(exec, StrictMode).toObject(exec);
I think that toObject can throw, in which case getLength below will has a sad. So, you need to check for exception before getLength and after. Please add a test for this. I think all you need is to pass in undefined or null as 'this'. This is the kind of thing that is easier to get right if you write it in JS.
> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:1112 > + JSValue e = getProperty(exec, thisObj, index);
It's a bit of a shame that this access is always virtual, with no fast path for arrays. This kind of thing sometimes goes faster in the JIT, since it will specialize for arrays if that's what the website uses.
Dean Jackson
Comment 7
2015-03-22 15:21:02 PDT
Created
attachment 249208
[details]
Patch
Geoffrey Garen
Comment 8
2015-03-23 10:55:32 PDT
Comment on
attachment 249208
[details]
Patch r=me
Dean Jackson
Comment 9
2015-03-23 14:38:38 PDT
Committed
r181871
: <
http://trac.webkit.org/changeset/181871
>
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