Closed Bug 2027765 Opened 1 month ago Closed 1 month ago

Avoid passing default Unicode extension values to ICU

Categories

(Core :: JavaScript: Internationalization API, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 3 open bugs)

Details

Attachments

(1 file)

ICU has fast paths when no Unicode extension sequences are present on a locale identifier. For example we should avoid passing en-u-nu-latn to ICU, because en defaults to the latn numbering system.

This should help bug 1943902 and bug 1968581: Without Unicode extension sequences, the _appendKeywords calls under ulocimp_forLanguageTag should go away.

Changes "LocaleNegotiation" to longer get the default calendar and numbering system
when calling ResolveLocale. Instead we use default as a placeholder and when

  1. Creating a new ICU4C object, we don't add Unicode extensions whose value is default.
  2. Returning the resolved options object, we retrieve the actual locale-specific value.

AssertCanonicalLocale was changed to recover from OOM to allow passing non-rooted
JSLinearString* to it. This simplifies callers and we don't have to perform
unnecessary rooting for debug-only code.

Blocks: sm-icu
Severity: -- → N/A
Priority: -- → P1
Pushed by andre.bargull@gmail.com: https://github.com/mozilla-firefox/firefox/commit/66cf3d74aed3 https://hg.mozilla.org/integration/autoland/rev/42c2d1683f4f Faster default locale calendar and numbering system. r=spidermonkey-reviewers,dminor
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: