WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
185476
[JSC] Fix ArraySpeciesCreate to return a new Array when the given object is not an array
https://bugs.webkit.org/show_bug.cgi?id=185476
Summary
[JSC] Fix ArraySpeciesCreate to return a new Array when the given object is n...
Leo Balter
Reported
2018-05-09 09:29:05 PDT
[JSC] Fix ArraySpeciesCreate to return a new Array when the given object is not an array
Attachments
Patch
(2.23 KB, patch)
2018-05-09 09:31 PDT
,
Leo Balter
no flags
Details
Formatted Diff
Diff
Patch
(1.98 KB, patch)
2018-05-09 10:06 PDT
,
Leo Balter
no flags
Details
Formatted Diff
Diff
Patch
(1.98 KB, patch)
2018-05-09 10:13 PDT
,
Leo Balter
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Leo Balter
Comment 1
2018-05-09 09:31:11 PDT
Created
attachment 339969
[details]
Patch
Yusuke Suzuki
Comment 2
2018-05-09 09:55:54 PDT
Comment on
attachment 339969
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=339969&action=review
> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:256 > + // If isArray is false, return ? ArrayCreate(length). > + JSGlobalObject* globalObject = thisObject->globalObject(); > + JSValue newValue = constructArrayWithSizeQuirk(exec, nullptr, globalObject, jsNumber(length), exec->newTarget()); > + JSObject* newObject = newValue.toObject(exec); > RETURN_IF_EXCEPTION(scope, exceptionResult()); > + return std::make_pair(SpeciesConstructResult::CreatedObject, newObject);
Let's return `std::make_pair(SpeciesConstructResult::FastPath, nullptr)` since it creates an Array(length), it is fast path case.
Leo Balter
Comment 3
2018-05-09 10:06:47 PDT
Created
attachment 339974
[details]
Patch
Leo Balter
Comment 4
2018-05-09 10:13:17 PDT
Created
attachment 339977
[details]
Patch
Yusuke Suzuki
Comment 5
2018-05-09 10:14:13 PDT
Comment on
attachment 339977
[details]
Patch r=me
WebKit Commit Bot
Comment 6
2018-05-09 10:29:45 PDT
Comment on
attachment 339977
[details]
Patch Clearing flags on attachment: 339977 Committed
r231572
: <
https://trac.webkit.org/changeset/231572
>
WebKit Commit Bot
Comment 7
2018-05-09 10:29:46 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8
2018-05-09 10:30:28 PDT
<
rdar://problem/40096808
>
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