forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 44
Intl: accept legacy IANA primary zones (CET, CST6CDT, EET, EST5EDT, MET, MST7MDT, PST8PDT, WET) #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
robobun
wants to merge
1
commit into
main
Choose a base branch
from
farm/eb3d4eac/intl-datetimeformat-legacy-zones
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Intl: accept legacy IANA primary zones (CET, CST6CDT, EET, EST5EDT, MET, MST7MDT, PST8PDT, WET) #227
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The comment states these identifiers "are first-class
Zones in the IANAetceterafile (not backward links)", but as of tzdata 2024b (Sep 2024) all eight were moved out ofetceteraand are nowLinkentries in thebackwardfile. The code change is still correct — test262/ECMA-402 require these to be accepted regardless — but consider rewording the rationale to e.g. "legacy POSIX-style IANA identifiers required by ECMA-402/test262" so the comment doesn't go stale against current IANA data.Extended reasoning...
What the issue is
The newly added comment at
IntlObject.cpp:1954-1958(and the PR description) asserts thatCET,CST6CDT,EET,EST5EDT,MET,MST7MDT,PST8PDT,WET"are first-classZones in the IANAetceterafile (not backward links)". That was historically accurate, but it is no longer true at the time this PR was written.Why it's stale
In tzdata 2024b (released 2024-09-04), the IANA tz maintainers moved all of these names — along with
EST,HST,MST— out ofetceteraand into thebackwardfile asLinkentries pointing at geographical zones. The 2024b NEWS entry reads:Checking upstream confirms it:
etceterano longer contains any of the eight names, andbackwardcontains all of them — e.g.Link Europe/Brussels CET,Link America/Chicago CST6CDT,Link America/Los_Angeles PST8PDT. So the comment is wrong on both counts: they are not inetcetera, and they are backward links.Step-by-step proof
Etc/GMT,Etc/UTC,Etc/GMT±N,GMT, and a handful ofEtc/links. None ofCET,CST6CDT,EET,EST5EDT,MET,MST7MDT,PST8PDT,WETappear.backwardfrom the same repo: each of the eight appears as aLinkline targeting a geographical zone.Zones in the IANAetceterafile (not backward links)" — is factually incorrect against current upstream tzdata.Why this doesn't affect correctness of the code
The functional change — whitelisting these eight names in
isValidTimeZoneNameFromICUTimeZone— is still right. ECMA-402 and test262 (intl402/DateTimeFormat/timezone-case-insensitive.js) require these identifiers to be accepted and to round-trip throughresolvedOptions().timeZoneregardless of whether IANA currently classifies them as Zones or Links, and ICU's canonical enumeration still surfaces them. Only the rationale in the comment is misleading; a future maintainer cross-referencing IANA could be confused about why the whitelist exists.Suggested fix
Reword the comment to avoid asserting current IANA Zone-vs-Link status, e.g.:
This keeps the rationale durable even as IANA reshuffles Zone/Link classifications.