Remove Array generics
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: arai, Assigned: evilpie)
References
(Blocks 1 open bug)
Details
(Keywords: addon-compat, dev-doc-complete, site-compat)
Attachments
(2 files)
Array generics are non-standard SpiderMonkey extension and they should be removed. * Array.concat * Array.every * Array.filter * Array.forEach * Array.indexOf * Array.join * Array.lastIndexOf * Array.map * Array.pop * Array.push * Array.reduce * Array.reduceRight * Array.reverse * Array.shift * Array.slice * Array.some * Array.sort * Array.splice * Array.unshift
Updated•8 years ago
|
Comment 1•8 years ago
|
||
Posted the site compatibility doc: https://www.fxsitecompat.com/en-US/docs/2015/array-string-generics-will-be-removed/
Comment 2•7 years ago
|
||
We should probably add telemetry and then warnings.
Reporter | ||
Comment 3•7 years ago
|
||
Some of them should be used frequently (like, Array.slice, Array.forEach), and some other won't be. searching AMO repository might give us some data. not sure if it worth getting telemetry for each function tho.
What about Array.from() and Array.isArray() ? Does this bug mean anything starting with Array. or only the specific listed methods?
Reporter | ||
Comment 6•7 years ago
|
||
Array.from and Array.isArray (and Array.of) are in spec. this bug is about non-standard static methods listed in comment #0.
Assignee | ||
Comment 7•5 years ago
|
||
Sadly some of those functions still have quite a few uses inside Firefox. If we added a warning those might go away, but would also annoy other developers.
Comment 8•5 years ago
|
||
(In reply to Tom Schuster [:evilpie] from comment #7)
Sadly some of those functions still have quite a few uses inside Firefox. If we added a warning those might go away, but would also annoy other developers.
Which other developers are using these functions?
Assignee | ||
Comment 9•5 years ago
|
||
BMO uses the generic Array.forEach, luckily they seem to provide a polyfill. The code comes from http://dean.edwards.name/base/forEach.js.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 11•4 years ago
•
|
||
Some the measured values are still extremely high, especially slice
and forEach
. On the other hand I haven't seen any fallout from this change on Nightly. Maybe there a lot of instances where websites already have some fallback/polyfill for other browsers.
Assignee | ||
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/311d8c50d88b Remove JavaScript Array generics. r=jandem
Comment 16•4 years ago
|
||
Backed out changeset 311d8c50d88b (Bug 1222547) for spidermonkey bustages on JSFunction.h:568.
Backout: https://hg.mozilla.org/integration/autoland/rev/7d4b2dc29c17629de982dd50b1b76244ae943574
Push that started the failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Csuccess%2Ctestfailed%2Cbusted%2Cexception&revision=311d8c50d88b1603a4e861eb50a8aeec12aebae5&selectedJob=268661949
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=268661949&repo=autoland&lineNumber=9651
Assignee | ||
Comment 17•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/ee339b902006 Remove JavaScript Array generics. r=jandem https://hg.mozilla.org/integration/autoland/rev/004f5255d2fc Remove telemetry. r=jandem
Comment 19•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ee339b902006
https://hg.mozilla.org/mozilla-central/rev/004f5255d2fc
Comment 20•4 years ago
|
||
Posted site compatibility note: https://www.fxsitecompat.dev/en-CA/docs/2019/non-standard-array-generics-have-been-removed/
Comment 21•4 years ago
|
||
== Change summary for alert #23288 (as of Mon, 30 Sep 2019 16:54:49 GMT) ==
Improvements:
0.49% Base Content JS macosx1014-64-shippable opt 4,080,544.00 -> 4,060,677.33
0.39% Base Content JS linux64 opt 4,071,397.33 -> 4,055,626.67
0.38% Base Content JS linux64-qr opt 4,071,344.00 -> 4,055,760.00
0.38% Base Content JS linux64-shippable opt 4,071,317.33 -> 4,055,680.00
0.38% Base Content JS linux64-shippable-qr opt 4,071,317.33 -> 4,055,653.33
0.38% Base Content JS windows10-64 opt 4,138,698.67 -> 4,122,928.00
0.38% Base Content JS windows10-64-qr opt 4,138,672.00 -> 4,122,901.33
0.38% Base Content JS windows10-64-shippable opt 4,138,698.67 -> 4,122,981.33
0.38% Base Content JS windows10-64-shippable-qr opt 4,138,752.00 -> 4,122,901.33
0.33% Base Content JS windows7-32 opt 3,239,056.00 -> 3,228,528.00
0.32% Base Content JS windows7-32-shippable opt 3,239,045.33 -> 3,228,528.00
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=23288
Comment 22•4 years ago
|
||
Removed section about array generics on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Announced removal on Fx71 for developers https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/71#JavaScript
Updated•4 years ago
|
Description
•