The default locale should not contain a Unicode extension sequence - #5125
Open
jessealama wants to merge 1 commit into
Open
The default locale should not contain a Unicode extension sequence#5125jessealama wants to merge 1 commit into
jessealama wants to merge 1 commit into
Conversation
gibson042
requested changes
Sep 2, 2026
gibson042
left a comment
Member
There was a problem hiding this comment.
I think I'd rather see this covered by an extended [and possibly renamed] test/intl402/default-locale-is-canonicalized.js.
Member
|
I've also opened an issue to explore allowing the currently nonconforming behavior: tc39/ecma402#1098 |
ptomato
approved these changes
Sep 3, 2026
ptomato
left a comment
Member
There was a problem hiding this comment.
Notwithstanding Richard's proposed reorganization which I don't feel strongly about either way, the test contents LGTM.
jessealama
force-pushed
the
default-locale-no-unicode-extension
branch
from
September 6, 2026 21:02
8bdee29 to
5f7ee4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DefaultLocale()isn't supposed to contain a Unicode locale extension sequence.ResolveLocalesubstitutes it with an empty extension when no requested locale matches, so the resolved locale of an Intl object, constructed without a locale argument, should never contain"-u-".It looks like we don't currently test this. The new test checks it for every Intl service constructor.
This is the requirement underlying #615. The tests there append
"-u-"to the default locale, which is OK, but only if the default locale doesn't already have one. Under the C locale, JSC reports"en-US-u-va-posix"as its default, and this test makes that failure visible.Spec: https://tc39.es/ecma402/#sec-defaultlocale