Closed trflynn89 closed 10 months ago
We discuss this in TG2 Dec 14 2023 and think it is truely an issue. Frank will take action to produce a Normative PR around step 5.f / 5.g of ApplyUnicodeExtensionToTag which similar to what ResolveLocale did in
step 9.i.iii.3 "3. Set optionsValue to the String value resulting from canonicalizing optionsUValue as a value of key ukey per Unicode Technical Standard #35 Part 1 Core, Annex C LocaleId Canonicalization Section 5 Canonicalizing Syntax, Processing LocaleIds."
@FrankYFTang @gibson042 said he will review that PR
Proposed fix in https://github.com/tc39/ecma402/pull/846
In
ApplyUnicodeExtensionToTag
andResolveLocale
, we loop over the provided relevant extension keys, and set the corresponding internal slot of theresult
record to the value present in either the locale string oroptions
object:This happens before the values are canonicalized via
InsertUnicodeExtensionAndCanonicalize
:Thus, the locale string of the corresponding Intl object is canonicalized, but the extension key internal slots are non-canonical.
The formatjs polyfill shows this issue:
That prints:
test262 expects
loc.calendar
to be canonicalized (and that is how v8 and spidermonkey already behave).