Use counter for 5-to-8-character language subtags in Intl.Locale constructor
Categories
(Core :: JavaScript: Internationalization API, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox136 | --- | fixed |
People
(Reporter: hsivonen, Assigned: hsivonen)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
See https://github.com/unicode-org/icu4x/issues/3989 and TG2 discussion of the issue in https://docs.google.com/document/d/1tfGW373MuTuI5AJuZOCCDlMhA8Qix_vrhYxva8RUjAw/edit?tab=t.0 .
Let's add a use counter for 5-to-8-character language subtags in the Intl.Locale constructor to see if it would be sufficiently Web-compatible to start treating them as language tag syntax errors.
Assignee | ||
Comment 1•1 month ago
|
||
The use counter should probably count usage more broadly than just in the Intl.Locale
constructor. It seems to me the place for the use counter is between these two lines https://searchfox.org/mozilla-central/rev/cdfe21b20eacfaa6712dd9821d6383859ce386c6/intl/components/src/Locale.cpp#1108-1109 and to make it possible to update a use counter there, the JSContext needs to become one more argument that flows to that point from https://searchfox.org/mozilla-central/rev/cdfe21b20eacfaa6712dd9821d6383859ce386c6/js/src/builtin/intl/LanguageTag.cpp#27 .
Assignee | ||
Comment 2•1 month ago
|
||
https://searchfox.org/mozilla-central/rev/cdfe21b20eacfaa6712dd9821d6383859ce386c6/js/src/vm/RealmFuses.cpp#83 shows a pre-existing use counter for JS.
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 3•1 month ago
|
||
Updated•1 month ago
|
Assignee | ||
Comment 4•1 month ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #1)
The use counter should probably count usage more broadly than just in the
Intl.Locale
constructor.
Or not, rather, since the main point of this is finding the cases where we currently retain and return a 5-to-8-character language instead of it being invisible if such a language failed to parse or failed to match.
Assignee | ||
Comment 5•1 month ago
|
||
I don't know how to write a test for this, but the patch seemed to be doing thing when looking at it in a debugger.
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Comment 7•1 month ago
|
||
Backed out for causing build bustages @ XPCJSRuntime.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/51d10b5db2e19bc6614930f3ea8b2181c5ff5f36
Assignee | ||
Comment 8•1 month ago
|
||
The failure was due to a bad automerge with bug 1940109. Re-queued landing with a manual adjustment to the merged code.
Comment 10•29 days ago
|
||
bugherder |
Description
•