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

Normative: Remove relativeTo option from Duration.p.add/subtract #2841

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented May 15, 2024

This is part of the ongoing effort, at implementations' request, to reduce the code size and complexity of the proposal.

Removes the options parameter from Temporal.Duration.prototype.add and Temporal.Duration.prototype.subtract. Everything else remains the same: Additions and subtractions that previously succeeded without relativeTo, still succeed, with the same results. Additions and subtractions that previously threw if there was no relativeTo, now just throw unconditionally.

Closes: #2825

@ptomato
Copy link
Collaborator Author

ptomato commented May 15, 2024

To be presented at the June 2024 TC39 meeting. Marking as draft until then.

Tests are in tc39/test262#4081.

@ptomato ptomato marked this pull request as draft May 15, 2024 19:15
@ptomato ptomato mentioned this pull request May 15, 2024
91 tasks
@arshaw
Copy link
Contributor

arshaw commented May 16, 2024

This looks great to me

Removes the options parameter from Temporal.Duration.prototype.add and
Temporal.Duration.prototype.subtract. Everything else remains the same:
Additions and subtractions that previously succeeded without relativeTo,
still succeed, with the same results. Additions and subtractions that
previously threw if there was no relativeTo, now just throw
unconditionally.

Closes: #2825
@ptomato ptomato marked this pull request as ready for review June 13, 2024 11:56
@ptomato
Copy link
Collaborator Author

ptomato commented Jun 13, 2024

This normative change reached consensus at the TC39 plenary of 2024-06-12.

@ptomato ptomato merged commit b0e152e into main Jun 13, 2024
5 checks passed
@ptomato ptomato deleted the 2825-addition-relativeto branch June 13, 2024 12:03
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.

Remove options parameter from Duration.p.add/subtract
3 participants