-
Notifications
You must be signed in to change notification settings - Fork 157
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
Fixes for editorial issues #2708
Conversation
In BalancePossiblyInfiniteTimeDurationRelative, we call AddDaysToZonedDateTime with the overflow parameter unconditionally set to 'constrain'. In this case, we can just omit it, since that's also the default value. Thanks to Anba for spotting this. Closes: #2693
I thought we were always calling this with largestUnit "day" if the largestUnit was smaller than days, but that's not the case. Just remove this assertion because it doesn't make any sense, and the spec is correct without it. Closes: #2695
This avoids calling NanosecondsToDays with the precalculated datetime parameter present but undefined, which is disallowed according to that operation's type assertions. Credits to Anba for catching this. Closes: #2694
Thanks again to Anba for spotting that this _instant_ is used lower down even if it wasn't created. Closes: #2702
…spec Change the reference code so that these operations work exactly like in the spec text, instead of the looping implementation that the code previously had.
…oDays This approach was suggested by Anba. All of these steps are unobservable in any case, so they can be edited and rearranged as necessary. Closes: #2703
As suggested by Anba, the precalculation will be done at the start of DifferenceZonedDateTime if it is not done prior, so we can unconditionally do it prior. Closes: #2704
AdjustRoundedDurationDays can be called with _precalculatedPlainDateTime_ undefined, but it may only be undefined if we take the fast path. Express this better with an assertion. Thanks to Anba for pointing this out. Closes: #2705
In Duration.p.round(), the smallestUnit condition for precalculating the PlainDateTime is already subsumed by the roundingGranularityIsNoop condition, so also checking smallestUnit is redundant. Thanks to Anba for pointing this out. Closes: #2698
As pointed out by Anba, in this call to RoundDuration the years...days parameters are not used within RoundDuration because unit is less than days. They are returned unchanged and discarded, so we may as well not pass them in. This change isn't observable by userland code. Closes: #2617
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2708 +/- ##
==========================================
+ Coverage 96.29% 96.33% +0.03%
==========================================
Files 20 20
Lines 12201 12211 +10
Branches 2286 2274 -12
==========================================
+ Hits 11749 11763 +14
- Misses 389 390 +1
+ Partials 63 58 -5
☔ View full report in Codecov by Sentry. |
if (s1 !== s2) return ComparisonResult(s1 - s2); | ||
if (ms1 !== ms2) return ComparisonResult(ms1 - ms2); | ||
if (µs1 !== µs2) return ComparisonResult(µs1 - µs2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codecov claims the second and microsecond branches are not covered, could you have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added another commit on to tc39/test262#3944: tc39/test262@315b4df
Implement the changes from: tc39/proposal-temporal#2708 Differential Revision: https://phabricator.services.mozilla.com/D195881
Implement the changes from: tc39/proposal-temporal#2708 Differential Revision: https://phabricator.services.mozilla.com/D195881 UltraBlame original commit: 09aff6fb6f431199b708c9b326de74081373a598
Implement the changes from: tc39/proposal-temporal#2708 Differential Revision: https://phabricator.services.mozilla.com/D195881 UltraBlame original commit: 09aff6fb6f431199b708c9b326de74081373a598
Implement the changes from: tc39/proposal-temporal#2708 Differential Revision: https://phabricator.services.mozilla.com/D195881 UltraBlame original commit: 09aff6fb6f431199b708c9b326de74081373a598
Implement the changes from: tc39/proposal-temporal#2708 Differential Revision: https://phabricator.services.mozilla.com/D195881
Most of these are minor issues with #2671. Best reviewed commit by commit, each commit message contains an explanation and a link to the issue tracker.
Cc @anba who reported all of these issues.