Skip to content
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

Support Node 22 & 23 #331

Merged
merged 5 commits into from
Mar 31, 2025
Merged

Support Node 22 & 23 #331

merged 5 commits into from
Mar 31, 2025

Conversation

justingrant
Copy link
Contributor

@justingrant justingrant commented Mar 30, 2025

Support Node 22 & 23. In addition to changing expected failures files for bugs that Node fixed, there were two Node changes that required polyfill code changes:

  • Now that Node 22 supports offset time zones in Intl.DTF, we needed to stop throwing when these IDs were supplied, and we needed to guard against U+2212 (unicode minus) in offset time zone IDs because Node doesn't catch these (yet).
  • Node 23 adds Intl.DurationFormat, and this PR fixes an infinite recursive loop (accidentally introduced in 19b00b2) that occurred if a native Intl.DurationFormat was present.

Fixes #323.

Changes the default script timeout for Test262 from 30s to 60s to
accommodate longer tests we now have. By changing this timeout in
`runtest262.mjs` instead of `npm run test262`, we restore the ability
for an IDE debugger like VS Code to use `npm run test262` with a longer
`TIMEOUT` environment variable to ensure that debug sessions can be
much longer than one minute.
@justingrant justingrant force-pushed the node-23 branch 3 times, most recently from bd2c7df to dc22448 Compare March 30, 2025 20:19
@justingrant justingrant force-pushed the node-23 branch 3 times, most recently from 23d6854 to 8aba37c Compare March 30, 2025 20:46
Updates tests to handle Node 22 & 23, including newly-working tests.

Also removes expected-failure references to a few tests that were
removed recently.
The previous commit 19b00b2 was a bit too overzealous in removing
saving primordials, because saving was actually needed in the case
of `DurationFormat`'s `format` and `formatToParts` methods.

This commit restores saving these methods before we polyfill them.
In Node 23, offset time zone IDs are now supported by
`Intl.DateTimeFormat`.

This commit changes the polyfill to handle these IDs.
@justingrant justingrant marked this pull request as ready for review March 30, 2025 20:53
@justingrant justingrant requested review from ptomato and 12wrigja March 30, 2025 20:53
Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Much appreciated! I'll cut the new release now.

Comment on lines -9 to -10
# temporal-test262-runner doesn't support the $262 global object
intl402/DateTimeFormat/proto-from-ctor-realm.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Note, I added this in #282 in order to be able to support js-temporal/temporal-test262-runner#19, but then we decided to stick to npm releases of temporal-test262-runner only. When we update temporal-test262-runner, we'll need to add this back in.

@ptomato ptomato merged commit c29428c into main Mar 31, 2025
27 checks passed
@ptomato ptomato deleted the node-23 branch March 31, 2025 17:20
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.

Run tests with Node 22 and 23
2 participants