Skip to content

Editorial: Account for [[pattern]] etc. in AdjustDateTimeStyleFormat#3275

Merged
ptomato merged 1 commit intomainfrom
3062-adjust-date-time-style-again
Feb 11, 2026
Merged

Editorial: Account for [[pattern]] etc. in AdjustDateTimeStyleFormat#3275
ptomato merged 1 commit intomainfrom
3062-adjust-date-time-style-again

Conversation

@ptomato
Copy link
Collaborator

@ptomato ptomato commented 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.

@ptomato
Copy link
Collaborator Author

ptomato commented Feb 10, 2026

cc @anba

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (978311d) to head (920fbb8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3275   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files          22       22           
  Lines       10457    10457           
  Branches     1808     1808           
=======================================
  Hits        10258    10258           
  Misses        182      182           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anba
Copy link
Contributor

anba commented Feb 10, 2026

If allowedOptions is changed to a list of property names, then step 6.a needs to be updated from:

6.a. Set the field of formatOptions whose name is fieldName to the value of the field of baseFormat whose name is fieldName.

to:

6.a. Set formatOptions.[[<fieldName>]] to baseFormat.[[<fieldName>]].

Because I don't think it's valid to refer to an internal slot using a String value.

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 ptomato force-pushed the 3062-adjust-date-time-style-again branch from d169a0c to 920fbb8 Compare February 10, 2026 20:02
@ptomato
Copy link
Collaborator Author

ptomato commented Feb 10, 2026

Good catch. I think we also technically need to check if baseFormat has a [[<prop>]] field before reading it. I've updated the PR.

Copy link
Contributor

@anba anba left a comment

Choose a reason for hiding this comment

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

Thanks!

@ptomato ptomato merged commit 64a2395 into main Feb 11, 2026
10 checks passed
@ptomato ptomato deleted the 3062-adjust-date-time-style-again branch February 11, 2026 18:50
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.

3 participants