Skip to content

Test removal of default locale fallback in Intl.Locale.p.getCollations - #5093

Merged
ptomato merged 4 commits into
tc39:mainfrom
gibson042:ecma402-1072-collation-no-default-locale-fallback
Jul 24, 2026
Merged

Test removal of default locale fallback in Intl.Locale.p.getCollations#5093
ptomato merged 4 commits into
tc39:mainfrom
gibson042:ecma402-1072-collation-no-default-locale-fallback

Conversation

@gibson042

Copy link
Copy Markdown
Member

Replaces #5092, which I accidentally closed.

This PR adds baseline tests for the return value of Intl.Locale.p.getCollations() reflecting the situation before normative PR tc39/ecma402#1072 in the first commit, and in the second commit makes the necessary changes for the normative PR.

Note that because the default locale is out-of-band, und-locale.js might pass or fail if the normative change is not implemented, depending on what the environment's default locale is. It should always pass regardless of the environment's default locale if the normative change is implemented correctly. Try running it with LC_ALL=de in the environment, for example.

@gibson042
gibson042 requested a review from a team as a code owner July 23, 2026 19:19
@gibson042
gibson042 force-pushed the ecma402-1072-collation-no-default-locale-fallback branch from 660dd6c to 1f7eb65 Compare July 23, 2026 19:19
ptomato added 2 commits July 23, 2026 15:24
This commit provides additional coverage for the CollationsOfLocale AO,
in preparation for the normative change in
tc39/ecma402#1072.

LLM disclosure: I used a bot to draft these tests, and hand-edited them
until I was satisfied. default-locale-fallback.js is heavily commented,
but I did actually remove all the LLM comment spew; what's left are my
own comments.
With normative PR tc39/ecma402#1072, the
unmatched locales (e.g. qfz, qga-DE, etc.) are hardcoded to return
the root collations ["emoji", "eor"] from getCollations(). The und
locales are no longer hardcoded, but it's a safe assumption that they
will also return the root collations. Combine the two tests that dealt
with und and unmatched locales into one.
@gibson042
gibson042 force-pushed the ecma402-1072-collation-no-default-locale-fallback branch from 1f7eb65 to b93b34a Compare July 23, 2026 19:24
@gibson042
gibson042 force-pushed the ecma402-1072-collation-no-default-locale-fallback branch from b93b34a to 3cb8424 Compare July 23, 2026 19:28

@ptomato ptomato left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubber-stamp (I actually opened this PR originally and Richard reviewed it)

@ptomato
ptomato merged commit e16bc71 into tc39:main Jul 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants