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: change ordering of balancing operations in Temporal.Durati… #2517

Merged
merged 2 commits into from
Apr 10, 2023

Conversation

guijemont
Copy link
Collaborator

…on.prototype.round

If we balance the bigger units before the smaller ones, then we never properly balance the days that are added from balancing units up to day length. Changing the order of operations ensures proper balancing of all units.
There is also no more need for the call to MoveRelativeZonedDateTime() in the end of the method, so it's been removed.

Closes: #2508

@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Merging #2517 (98dea1e) into main (483aca8) will decrease coverage by 0.46%.
The diff coverage is 100.00%.

❗ Current head 98dea1e differs from pull request most recent head e25293c. Consider uploading reports for the commit e25293c to get more accurate results

@@            Coverage Diff             @@
##             main    #2517      +/-   ##
==========================================
- Coverage   95.97%   95.51%   -0.46%     
==========================================
  Files          20       20              
  Lines       11123    10928     -195     
  Branches     2126     2033      -93     
==========================================
- Hits        10675    10438     -237     
- Misses        387      430      +43     
+ Partials       61       60       -1     
Impacted Files Coverage Δ
polyfill/lib/duration.mjs 96.00% <100.00%> (-0.03%) ⬇️

... and 13 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

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

Looks good. I'm glad this bugfix turned out to be so straightforward.

FYI, the process for normative PRs is that I mark this as a draft so that it doesn't get merged accidentally before being presented in the TC39 meeting. Then once it's been approved, I'll un-draft it, and push an update that updates the test262 submodule to include tc39/test262#3793 so that the tests pass.

@ptomato ptomato marked this pull request as draft March 9, 2023 19:40
@ptomato ptomato marked this pull request as ready for review April 10, 2023 19:46
@ptomato
Copy link
Collaborator

ptomato commented Apr 10, 2023

This reached consensus at the March 2023 TC39 meeting. Test262 tests are in tc39/test262#3793.

guijemont and others added 2 commits April 10, 2023 12:52
…on.prototype.round

If we balance the bigger units before the smaller ones, then we never
properly balance the days that are added from balancing units up to day
length. Changing the order of operations ensures proper balancing of all
units.
There is also no more need for the call to MoveRelativeZonedDateTime()
in the end of the method, so it's been removed.

Closes: tc39#2508
@ptomato ptomato merged commit b63bffb into tc39:main Apr 10, 2023
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 18, 2023
…poral.Duration.prototype.round. r=spidermonkey-reviewers,mgaudet

Implement the changes from <tc39/proposal-temporal#2517>.

Depends on D182039

Differential Revision: https://phabricator.services.mozilla.com/D182040
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this pull request Jul 19, 2023
…poral.Duration.prototype.round. r=spidermonkey-reviewers,mgaudet

Implement the changes from <tc39/proposal-temporal#2517>.

Depends on D182039

Differential Revision: https://phabricator.services.mozilla.com/D182040
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jul 21, 2023
…poral.Duration.prototype.round. r=spidermonkey-reviewers,mgaudet

Implement the changes from <tc39/proposal-temporal#2517>.

Depends on D182039

Differential Revision: https://phabricator.services.mozilla.com/D182040

UltraBlame original commit: 56d3e3e518e00ecc082fd1cd862a1d0ac5cea7af
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jul 21, 2023
…poral.Duration.prototype.round. r=spidermonkey-reviewers,mgaudet

Implement the changes from <tc39/proposal-temporal#2517>.

Depends on D182039

Differential Revision: https://phabricator.services.mozilla.com/D182040

UltraBlame original commit: 56d3e3e518e00ecc082fd1cd862a1d0ac5cea7af
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jul 21, 2023
…poral.Duration.prototype.round. r=spidermonkey-reviewers,mgaudet

Implement the changes from <tc39/proposal-temporal#2517>.

Depends on D182039

Differential Revision: https://phabricator.services.mozilla.com/D182040

UltraBlame original commit: 56d3e3e518e00ecc082fd1cd862a1d0ac5cea7af
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.

Duration.p.round doesn't balance from hours (or smaller) to weeks (or larger) units
2 participants