-
Notifications
You must be signed in to change notification settings - Fork 153
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
Editorial: Various changes encountered while working on Duration math #2609
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using _largestUnit_ here was unintentional and doesn't match the argument types of RoundDuration.
…fill While investigating integer math, this discrepancy has been unhelpful. If I had to choose one of the two ways of implementing it, I'd choose this one anyway, because it's more concise and deals with the quantity that is actually returned to the user.
This needs some changes in callers because of a bug in Ecmarkup (see tc39/ecmarkup#529), but I think the change is probably for the better anyway.
toString() can only round the seconds and lower units, so we do not need to pass all the units in to RoundDuration - we can only round to seconds increments and smaller anyway. This makes it clearer that implementations can treat seconds as a single number if they wish.
Codecov Report
@@ Coverage Diff @@
## main #2609 +/- ##
==========================================
- Coverage 95.98% 95.98% -0.01%
==========================================
Files 20 20
Lines 11573 11572 -1
Branches 2198 2198
==========================================
- Hits 11108 11107 -1
Misses 401 401
Partials 64 64
|
Ms2ger
approved these changes
Jun 21, 2023
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Sep 13, 2023
…udet Implement the `Duration.prototype.total` changes from <tc39/proposal-temporal#2609>. No change in behaviour, because our implementation already matched the updated spec. Only changed variables names to `total` to match the new spec and removed comments about adding `quotient + remainder`, which no longer apply because the addition operation was removed from the spec. Differential Revision: https://phabricator.services.mozilla.com/D185405
vinnydiehl
pushed a commit
to vinnydiehl/mozilla-unified
that referenced
this pull request
Sep 14, 2023
…udet Implement the `Duration.prototype.total` changes from <tc39/proposal-temporal#2609>. No change in behaviour, because our implementation already matched the updated spec. Only changed variables names to `total` to match the new spec and removed comments about adding `quotient + remainder`, which no longer apply because the addition operation was removed from the spec. Differential Revision: https://phabricator.services.mozilla.com/D185405
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's another PR with various editorial improvements that I came across while working on the integer math in Durations. More explanations in the individual commit messages.