Remove String 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)
String generics are non-standard SpiderMonkey extension and they should be removed. * String.charAt * String.charCodeAt * String.concat * String.contains * String.endsWith * String.includes * String.indexOf * String.lastIndexOf * String.localeCompare * String.match * String.normalize * String.replace * String.search * String.slice * String.split * String.startsWith * String.substr * String.substring * String.toLocaleLowerCase * String.toLocaleUpperCase * String.toLowerCase * String.toUpperCase * String.trim * String.trimLeft * String.trimRight
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/
Assignee | ||
Comment 2•6 years ago
|
||
I think it's time we seriously investigate this and bug 1222547. The String variant is probably less used, but we definitely need to add some telemetry. The static String functions already have warnings, but the Array methods don't. This also means those are still used in Firefox code.
Assignee | ||
Comment 3•5 years ago
|
||
The telemetry for this produced quite interesting results.
method | usage |
---|---|
toLowerCase | 519106 (97.75%) |
concat | 4898 (0.92%) |
slice | 3490 (0.66%) |
trim | 3336 (0.63%) |
The rest is basically at 0%. source
I wonder if we should just go ahead and remove all of the rest? Except for toLowerCase even the rest feels quite low.
Comment 4•5 years ago
|
||
There's an old Mootools version in-tree, which, as part of its initialisation, seems to call String.toLowerCase. Maybe this Mootools version is still used on the Web and that's why toLowerCase
is so prominent in the telemetry data? In that case it's safe to remove toLowerCase
, because Mootools will add it back.
Assignee | ||
Comment 5•5 years ago
|
||
(In reply to André Bargull [:anba] from comment #4)
There's an old Mootools version in-tree, which, as part of its initialisation, seems to call String.toLowerCase. Maybe this Mootools version is still used on the Web and that's why
toLowerCase
is so prominent in the telemetry data? In that case it's safe to removetoLowerCase
, because Mootools will add it back.
Wow good find! I really hope this is true and we can just remove everything.
Assignee | ||
Comment 6•5 years ago
|
||
Comment 7•5 years ago
|
||
That really is an amazing find, anba. Wow.
Assignee | ||
Comment 8•5 years ago
|
||
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c59acf298136 Remove String generics. r=jorendorff https://hg.mozilla.org/integration/autoland/rev/a8c448b92913 Fix xpconnect test. r=smaug
Comment 10•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c59acf298136
https://hg.mozilla.org/mozilla-central/rev/a8c448b92913
Updated•5 years ago
|
Comment 11•5 years ago
|
||
== Change summary for alert #20084 (as of Sat, 23 Mar 2019 05:37:40 GMT) ==
Improvements:
1% Base Content JS linux64 pgo stylo 3,999,578.67 -> 3,968,909.33
1% Base Content JS linux64-pgo-qr opt stylo 3,999,470.67 -> 3,968,886.67
1% Base Content JS windows10-64-pgo-qr opt stylo 4,073,260.00 -> 4,046,252.00
1% Base Content JS windows10-64 pgo stylo 4,073,281.33 -> 4,046,340.00
1% Base Content JS osx-10-10 opt stylo 4,000,505.33 -> 3,974,025.33
0% Base Content JS windows7-32 pgo stylo 3,165,454.67 -> 3,150,896.00
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=20084
Comment 12•4 years ago
|
||
Posted site compatibility note: https://www.fxsitecompat.com/en-CA/docs/2019/non-standard-string-generics-have-been-removed/
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Sorry this slipped through somehow in time for Firefox 68.
Announced on Firefox 68 release notes: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/68#JavaScript
Updated the warning page that is shown in earlier Firefox versions: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_String_generics
Removed the entire "String generics" section from the String API docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
Description
•