Iterator.prototype[@@toStringTag] breaks web compatibility
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: avandolder, Assigned: avandolder)
References
(Regression)
Details
(Keywords: regression, site-compat)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Iterator.prototype[@@toStringTag] was created as non-writable in https://bugzilla.mozilla.org/show_bug.cgi?id=1640923, behind the javascript.options.experimental.iterator_helpers
pref, which breaks web compatibility.
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Comment 4•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Updated•4 years ago
|
Can someone elaborate on exactly what broke? ie, what makes it not web compatible?
Assignee | ||
Comment 6•4 years ago
|
||
Defining toStringTag
on Iterator.prototype
(specifically, defining it as non-writable) causes regenerator to throw Uncaught TypeError: Symbol.toStringTag is read-only
here: https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js#L389
This causes sites like Slack and Discord to fail to render at all.
It could be that is an implementation issue specific to Firefox, I'm not 100% sure whether what regenerator does (polyfill Generators and set a toStringTag on their prototype) is legal under the spec or not.
That is the correct behaviour of OrdinarySetWithOwnDescriptor
when a parent has a non‑writable property.
Regenerator should be using Object.defineProperty
instead.
Alternatively, Regenerator should be doing if (Gp[toStringTagSymbol] !== "Generator") { Gp[toStringTagSymbol] = "Generator"; }
.
Thanks, that explains the issue.
Comment 9•4 years ago
|
||
The regenerator-runtime
problem discussed above should now be fixed in regenerator-runtime@0.13.6, thanks to this PR from ljharb (with tests by ExE Boss): https://github.com/facebook/regenerator/pull/400. I'm the maintainer of Regenerator, by the way.
Updated•4 years ago
|
Description
•