Skip to content

Intl.Locale: apply CLDR alias mappings during canonicalization - #36731

Open
robobun wants to merge 6 commits into
mainfrom
farm/b450b143/intl-locale-canonicalize
Open

Intl.Locale: apply CLDR alias mappings during canonicalization#36731
robobun wants to merge 6 commits into
mainfrom
farm/b450b143/intl-locale-canonicalize

IntlCanonicalize: keep the root locale empty on older macOS

367ce73
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 2, 2026 in 27m 37s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/bindings/IntlCanonicalize.cpp:18-22 macOS root-locale guard may not cover und + Unicode extension

Annotations

Check warning on line 22 in src/jsc/bindings/IntlCanonicalize.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

macOS root-locale guard may not cover und + Unicode extension

The empty-string guard covers bare `und` (ICU locale ID `""`) but `uloc_forLanguageTag("und-u-ca-gregory")` yields `"@calendar=gregorian"` — first byte `'@'`, so it falls through to `ualoc_canonicalForm` unguarded. Whether the macOS 13/14 quirk also fires on empty-base-name-with-keywords is unproven, but no test covers it: consider adding `expect(new Intl.Locale("und-u-ca-gregory").toString()).toBe("und-u-ca-gregory")` alongside the existing `und` assertions so the macOS 13/14 CI lane settles it