WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
193127
Array.prototype.flat/flatMap have a minor bug in ArraySpeciesCreate
https://bugs.webkit.org/show_bug.cgi?id=193127
Summary
Array.prototype.flat/flatMap have a minor bug in ArraySpeciesCreate
Daniel Ehrenberg
Reported
2019-01-03 15:49:31 PST
There seems to be an = missing on line 764 of builtins/ArrayPrototype.js Test case: new (class extends Array { static get [Symbol.species]() { return document.all; } })(1, 2, 3).flat().constructor This should throw a TypeError (as document.all is not a constructor), but instead it returns Array (as document.all == null). map and filter have the correct error-throwing semantics.
Attachments
Patch
(36.26 KB, patch)
2019-01-07 22:14 PST
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews114 for mac-sierra
(465.47 KB, application/zip)
2019-01-07 23:25 PST
,
EWS Watchlist
no flags
Details
Patch
(36.27 KB, patch)
2019-01-08 08:00 PST
,
Yusuke Suzuki
saam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2019-01-07 16:44:47 PST
We should have a fancy new bytecode instruction `is_undefined_or_null` and use it as @isUndefinedOrNull(value) in builtin JS to make our builtin JS code readable, and do not consider about masquerades-as-undefined anymore.
Yusuke Suzuki
Comment 2
2019-01-07 22:14:42 PST
Created
attachment 358571
[details]
Patch
EWS Watchlist
Comment 3
2019-01-07 23:25:00 PST
Comment on
attachment 358571
[details]
Patch
Attachment 358571
[details]
did not pass mac-debug-ews (mac): Output:
https://webkit-queues.webkit.org/results/10667590
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 4
2019-01-07 23:25:01 PST
Created
attachment 358581
[details]
Archive of layout-test-results from ews114 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-sierra Platform: Mac OS X 10.12.6
Yusuke Suzuki
Comment 5
2019-01-08 08:00:34 PST
Created
attachment 358590
[details]
Patch
Saam Barati
Comment 6
2019-01-08 16:46:19 PST
Comment on
attachment 358590
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=358590&action=review
r=me
> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1402 > + if (!(child.m_type & SpecOther)) { > + setConstant(node, jsBoolean(false)); > + constantWasSet = true; > + break; > + }
You should also have a rule for !(child.m_type & ~SpecOther) => true
Yusuke Suzuki
Comment 7
2019-01-08 16:47:12 PST
Comment on
attachment 358590
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=358590&action=review
>> Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:1402 >> + } > > You should also have a rule for > !(child.m_type & ~SpecOther) => true
Sounds super nice! Fixed.
Yusuke Suzuki
Comment 8
2019-01-08 18:56:21 PST
Committed
r239761
: <
https://trac.webkit.org/changeset/239761
>
Radar WebKit Bug Importer
Comment 9
2019-01-08 18:57:49 PST
<
rdar://problem/47135853
>
Alexey Shvayka
Comment 10
2021-01-04 11:01:14 PST
***
Bug 171421
has been marked as a duplicate of this 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