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: Avoid dividing by zero in ZonedDateTime#round. #1582

Merged
merged 1 commit into from
Jun 28, 2021

Conversation

Ms2ger
Copy link
Collaborator

@Ms2ger Ms2ger commented Jun 28, 2021

Ref. #1502.

@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #1582 (2de1f5d) into main (0e24fd3) will decrease coverage by 23.26%.
The diff coverage is 100.00%.

❗ Current head 2de1f5d differs from pull request most recent head be68077. Consider uploading reports for the commit be68077 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1582       +/-   ##
===========================================
- Coverage   95.58%   72.31%   -23.27%     
===========================================
  Files          19       18        -1     
  Lines       10933     4797     -6136     
  Branches     1715     1049      -666     
===========================================
- Hits        10450     3469     -6981     
- Misses        472     1034      +562     
- Partials       11      294      +283     
Flag Coverage Δ
test262 72.31% <100.00%> (+0.01%) ⬆️
tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/zoneddatetime.mjs 89.41% <100.00%> (-9.24%) ⬇️
polyfill/lib/calendar.mjs 22.95% <0.00%> (-71.39%) ⬇️
polyfill/lib/intl.mjs 61.95% <0.00%> (-38.05%) ⬇️
polyfill/lib/instant.mjs 79.13% <0.00%> (-15.46%) ⬇️
polyfill/lib/plainmonthday.mjs 79.01% <0.00%> (-14.14%) ⬇️
polyfill/lib/plainyearmonth.mjs 83.42% <0.00%> (-12.99%) ⬇️
polyfill/lib/ecmascript.mjs 82.65% <0.00%> (-12.54%) ⬇️
polyfill/lib/plaindatetime.mjs 85.08% <0.00%> (-12.40%) ⬇️
polyfill/lib/timezone.mjs 81.66% <0.00%> (-11.80%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e24fd3...be68077. Read the comment docs.

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.

👍

@ptomato ptomato merged commit ba3c249 into main Jun 28, 2021
@ptomato ptomato deleted the zdt-round-div-zero branch June 28, 2021 19:38
@ljharb
Copy link
Member

ljharb commented Jun 28, 2021

This kind of seems normative, not editorial? (altho presumably one that implementors are unlikely to get wrong)

@ptomato
Copy link
Collaborator

ptomato commented Jun 28, 2021

I considered that, but I thought it was an editorial error because the division operation on two mathematical values in RoundTime step 3.b would not be defined in ℝ if the divisor is 0.

However, I'm glad you prompted me to take another look, because it seems there is still an editorial error. The result of AddInstant and therefore AddZonedDateTime is a BigInt, meaning the division in RoundTime 3.b is on operands of mixed type, which is an editorial error according to Mathematical operations. @Ms2ger care to fix it up?

@Ms2ger
Copy link
Collaborator Author

Ms2ger commented Jun 29, 2021

Done in #1585.

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.

3 participants