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

Temporal.Duration.prototype.round: Compare duration.[[Hours]] against absolute value #2679

Closed
anba opened this issue Sep 25, 2023 · 1 comment
Assignees

Comments

@anba
Copy link
Contributor

anba commented Sep 25, 2023

Step 27:

Else if duration.[[Hours]] ≥ 24, set hoursToDaysConversionMayOccur to true.

This should probably be abs(duration.[[Hours]]) ≥ 24.

@ptomato ptomato self-assigned this Sep 25, 2023
@ptomato
Copy link
Collaborator

ptomato commented Sep 25, 2023

Thanks for spotting this. It was introduced in User Code Calls Part 2 (#2657). I think a similar bug occurs with [[Minutes]] < 60 etc. a few lines down. I will push an update to Part 3 (#2671) of the PR fixing this.

ptomato added a commit that referenced this issue Sep 26, 2023
Fix for bug in User Code Calls Part 2 (51ea969), spotted by Anba. Thanks!
The existing code forgot to take negative durations into account.

Closes: #2679
ptomato added a commit that referenced this issue Sep 26, 2023
Fix for bug in User Code Calls Part 2 (51ea969), spotted by Anba. Thanks!
The existing code forgot to take negative durations into account.

Closes: #2679
ptomato added a commit that referenced this issue Sep 27, 2023
Fix for bug in User Code Calls Part 2 (51ea969), spotted by Anba. Thanks!
The existing code forgot to take negative durations into account.

Closes: #2679
ptomato added a commit that referenced this issue Oct 4, 2023
Fix for bug in User Code Calls Part 2 (51ea969), spotted by Anba. Thanks!
The existing code forgot to take negative durations into account.

Closes: #2679
@ptomato ptomato closed this as completed in 26369ba Oct 4, 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