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

Editorial: Split total() code path out of RoundRelativeDuration #2987

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Sep 30, 2024

In #2758 we kept the code paths for Duration.p.round() and Duration.p.total() the same. However, it is actually simpler to separate them in most places, except for NudgeToCalendarUnit.

  • Splits TotalRelativeDuration out of RoundRelativeDuration
  • Splits TotalTimeDuration out of RoundTimeDuration
  • Splits DifferenceZonedDateTimeWithTotal out of DifferenceZonedDateTimeWithRounding
  • Splits DifferencePlainDateTimeWithTotal out of DifferencePlainDateTimeWithRounding
  • Removes [[Total]] field from Nudge Result Record
  • Changes NudgeToCalendarUnit to return a record of { [[NudgeResult]], [[Total]] }

Closes: #2947

In #2758 we kept the code paths for Duration.p.round() and
Duration.p.total() the same. However, it is actually simpler to separate
them in most places, except for NudgeToCalendarUnit.

- Splits TotalRelativeDuration out of RoundRelativeDuration
- Splits TotalTimeDuration out of RoundTimeDuration
- Splits DifferenceZonedDateTimeWithTotal out of
  DifferenceZonedDateTimeWithRounding
- Splits DifferencePlainDateTimeWithTotal out of
  DifferencePlainDateTimeWithRounding
- Removes [[Total]] field from Nudge Result Record
- Changes NudgeToCalendarUnit to return a record of { [[NudgeResult]],
  [[Total]] }

Closes: #2947
@ptomato
Copy link
Collaborator Author

ptomato commented Sep 30, 2024

cc @arshaw

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 97.03704% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.37%. Comparing base (8c70250) to head (7326e72).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
polyfill/lib/ecmascript.mjs 96.80% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2987      +/-   ##
==========================================
+ Coverage   96.35%   96.37%   +0.02%     
==========================================
  Files          21       21              
  Lines       10519    10578      +59     
  Branches     1803     1810       +7     
==========================================
+ Hits        10136    10195      +59     
  Misses        325      325              
  Partials       58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ptomato ptomato mentioned this pull request Oct 1, 2024
27 tasks
@Ms2ger Ms2ger merged commit ae6edf0 into main Oct 1, 2024
10 checks passed
@Ms2ger Ms2ger deleted the 2947-split-total-code-path branch October 1, 2024 13:12
@arshaw
Copy link
Contributor

arshaw commented Oct 2, 2024

Looks good to me too!

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.

Editorial: Split out total() code path from RoundRelativeDuration
3 participants