Editorial: Work around inconsistency in CLDR data sources#3273
Merged
Conversation
See tc39/ecma402#1043. The format returned from DateTimeStyleFormat should also be able to be returned by the format matchers, but apparently because of the way the locale data in ECMA-402 is structured, which mirrors inconsistency in CLDR, this cannot be guaranteed. Work around this inconsistency in AdjustDateTimeStyleFormat by returning the original base format if it doesn't contain any disallowed fields, so that we don't accidentally replace it with a format matcher format. Closes: #3062
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3273 +/- ##
==========================================
- Coverage 98.09% 98.09% -0.01%
==========================================
Files 22 22
Lines 10464 10457 -7
Branches 1808 1808
==========================================
- Hits 10265 10258 -7
Misses 182 182
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
anba
reviewed
Feb 10, 2026
ptomato
added a commit
that referenced
this pull request
Feb 10, 2026
Based on Anba's suggestion: #3273 (comment) We pass a List of property names into AdjustDateTimeStyleFormat instead of a List of field names, so they can be compared directly with the "Property" column of the "Components of date and time formats" table. This avoids the problem of formats having other fields such as [[pattern]] and [[pattern12]] that would always conflict with the allowed fields. Co-Authored-By: André Bargull <andre.bargull@gmail.com>
ptomato
added a commit
that referenced
this pull request
Feb 10, 2026
Based on Anba's suggestion: #3273 (comment) We pass a List of property names into AdjustDateTimeStyleFormat instead of a List of field names, so they can be compared directly with the "Property" column of the "Components of date and time formats" table. This avoids the problem of formats having other fields such as [[pattern]] and [[pattern12]] that would always conflict with the allowed fields. Co-Authored-By: André Bargull <andre.bargull@gmail.com>
ptomato
added a commit
that referenced
this pull request
Feb 11, 2026
Based on Anba's suggestion: #3273 (comment) We pass a List of property names into AdjustDateTimeStyleFormat instead of a List of field names, so they can be compared directly with the "Property" column of the "Components of date and time formats" table. This avoids the problem of formats having other fields such as [[pattern]] and [[pattern12]] that would always conflict with the allowed fields. Co-Authored-By: André Bargull <andre.bargull@gmail.com>
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.
See tc39/ecma402#1043. The format returned from DateTimeStyleFormat should also be able to be returned by the format matchers, but apparently because of the way the locale data in ECMA-402 is structured, which mirrors inconsistency in CLDR, this cannot be guaranteed.
Work around this inconsistency in AdjustDateTimeStyleFormat by returning the original base format if it doesn't contain any disallowed fields, so that we don't accidentally replace it with a format matcher format.
Closes: #3062