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: Fix Instant rounding modes #2210
Conversation
Draft until presented at TC39. |
Codecov Report
@@ Coverage Diff @@
## main #2210 +/- ##
=======================================
Coverage 89.95% 89.95%
=======================================
Files 19 19
Lines 10901 10901
Branches 1683 1683
=======================================
Hits 9806 9806
Misses 1081 1081
Partials 14 14
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
As described in the documentation, the proposal champions' intention was for rounding of exact times to consider the Big Bang as the "zero" point, rather than the arbitrary zero point of the Unix epoch. The spec text didn't reflect this correctly.
2fadbea
to
aa6a5c2
Compare
Thanks, makes sense to me! |
This reached consensus at the July 2022 TC39 plenary meeting. |
… as zero https://bugs.webkit.org/show_bug.cgi?id=241622 Reviewed by Yusuke Suzuki. Implement the spec fix of tc39/proposal-temporal#2210. This change is quite simple, as we can just update the Int128 version of roundNumberToIncrement. * JSTests/test262/expectations.yaml: Mark four test cases as passing. * Source/JavaScriptCore/runtime/TemporalObject.cpp: (JSC::roundNumberToIncrement): (JSC::abs): Deleted. Canonical link: https://commits.webkit.org/251556@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
This change invalidated some other tests, for example https://github.com/tc39/test262/blob/main/test/built-ins/Temporal/ZonedDateTime/prototype/since/roundingincrement-non-integer.js: DifferenceTemporalZonedDateTime calls DifferenceInstant with
→
With
→
So the test needs to be changed as follows: - TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, "roundingIncrement 2.5 floors to 2");
+ TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, "roundingIncrement 2.5 floors to 2"); But I'm not sure this change was intentional by this PR. |
Whoops. I don't think it was ever correct to call RoundTemporalInstant on the difference between two instants, which should be a duration. I'll open a new issue for this. |
After I try to change my v8 code to sycn with 2210 my build break the following tests, I am not 100% sure that is because the same issue @anba mentioned or I have some bugs in my patch or some other pre-existing issues but I would like to mention these tests here so you will consider them when you work on #2320
|
@anba - do you see the same set of breakage or different? |
Yes, I see exactly the same failures. |
As described in the documentation, the proposal champions' intention was
for rounding of exact times to consider the Big Bang as the "zero" point,
rather than the arbitrary zero point of the Unix epoch. The spec text
didn't reflect this correctly.
Closes: #2191