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

RoundDuration: CreateTemporalDate incorrectly marked as infallible in step 8.l #2697

Closed
anba opened this issue Oct 10, 2023 · 1 comment
Closed
Assignees

Comments

@anba
Copy link
Contributor

anba commented Oct 10, 2023

RoundDuration, step 8.l:

Let wholeDaysLater be ! CreateTemporalDate(isoResult.[[Year]], isoResult.[[Month]], isoResult.[[Day]], calendar).

But isoResult can be outside the valid date-time range, for example consider:

Temporal.Duration.from({days:500_000_000}).round({relativeTo: new Temporal.PlainDate(2000, 1, 1), smallestUnit: "years"})
@ptomato
Copy link
Collaborator

ptomato commented Oct 11, 2023

Thanks for the test case. Will put this one in the next batch of editorial fixes, and add the test case to test262.

@ptomato ptomato self-assigned this Oct 11, 2023
ptomato added a commit that referenced this issue Oct 11, 2023
The AddISODate call in the previous lines may return a result record that
is out of range and cannot successfully be passed to CreateTemporalDate,
and so this step should be fallible.

Thanks to Anba for spotting this.

Closes: #2697
Closes: #2700
ptomato added a commit to ptomato/test262 that referenced this issue Oct 11, 2023
ptomato added a commit to ptomato/test262 that referenced this issue Oct 12, 2023
@Ms2ger Ms2ger closed this as completed in d1cd4e1 Oct 12, 2023
ptomato added a commit to ptomato/test262 that referenced this issue Oct 18, 2023
ptomato added a commit to tc39/test262 that referenced this issue Oct 18, 2023
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

No branches or pull requests

2 participants