Skip to content

feat(intl): implement ChainDateTimeFormat and UnwrapDateTimeFormat#4972

Open
xcb3d wants to merge 2 commits intoboa-dev:mainfrom
xcb3d:feat/intl-chain-datetimeformat
Open

feat(intl): implement ChainDateTimeFormat and UnwrapDateTimeFormat#4972
xcb3d wants to merge 2 commits intoboa-dev:mainfrom
xcb3d:feat/intl-chain-datetimeformat

Conversation

@xcb3d
Copy link
Contributor

@xcb3d xcb3d commented Mar 9, 2026

This Pull Request resolves the TODO comment "Should we support the ChainDateTimeFormat?" in date_time_format/mod.rs.

It changes the following:

  • Implement ChainDateTimeFormat (ECMA-402 §11.1.1.1) in the Intl.DateTimeFormat constructor
  • Add UnwrapDateTimeFormat (ECMA-402 §11.5.14) abstract operation
  • Update get format and resolvedOptions to use UnwrapDateTimeFormat

Implement the normative optional constructor mode for Intl.DateTimeFormat
per ECMA-402 §11.1.2 and §11.1.1:

- ChainDateTimeFormat: When called without  on a DateTimeFormat
  instance, store the new format via the [[FallbackSymbol]] property
  and return , matching legacy constructor behavior.

- UnwrapDateTimeFormat: Resolve the underlying DateTimeFormat from
  objects that may have been chained, used by both  and
  .

This mirrors the existing NumberFormat implementation for consistency.
@xcb3d xcb3d requested review from jedel1043 and nekevss as code owners March 9, 2026 11:13
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 49,713 49,713 0
Ignored 2,262 2,262 0
Failed 988 988 0
Panics 0 0 0
Conformance 93.86% 93.86% 0.00%

Tested main commit: dc02d4f354ac278dd845f529a3331001c4ea0ede
Tested PR commit: ce6c1734aa7f4bf104f8ca59c4e2d202fa855fd4
Compare commits: dc02d4f...ce6c173

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 26.31579% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.39%. Comparing base (6ddc2b4) to head (ce6c173).
⚠️ Report is 799 commits behind head on main.

Files with missing lines Patch % Lines
...e/engine/src/builtins/intl/date_time_format/mod.rs 26.31% 28 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4972       +/-   ##
===========================================
+ Coverage   47.24%   58.39%   +11.14%     
===========================================
  Files         476      556       +80     
  Lines       46892    61180    +14288     
===========================================
+ Hits        22154    35725    +13571     
- Misses      24738    25455      +717     

☔ 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.

@jedel1043 jedel1043 added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants