-
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
Normative: Change date AOs to accept mathematical values #2518
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2518 +/- ##
=======================================
Coverage 96.16% 96.16%
=======================================
Files 20 20
Lines 11285 11289 +4
Branches 2163 2163
=======================================
+ Hits 10852 10856 +4
Misses 369 369
Partials 64 64 |
d5337fe
to
9ab873a
Compare
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.
Thanks!
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.
Looks good, thanks!.
I might suggest being more specific about what is meant by "(epoch) time", since it could be confusing that we mean epoch milliseconds here, whereas in the rest of Temporal we use epoch nanoseconds. But on the other hand, maybe this is fine — it's very clear already that these are MV duplicates of the ECMA-262 operations, and the names are quite long already without adding "milliseconds" to them.
<emu-eqn id="eqn-mathematicalinleapyear" aoid="MathematicalInLeapYear"> | ||
MathematicalInLeapYear(_t_) | ||
= 0 if MathematicalDaysInYear(EpochTimeToEpochYear(_t_)) is 365 | ||
= 1 if MathematicalDaysInYear(EpochTimeToEpochYear(_t_)) is 366 | ||
</emu-eqn> |
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 hate seeing this redundancy, but I don't currently have enough time to determine which parts of it are necessary.
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 think the usage of EpochTimeToEpochYear (vs YearFromTime in ECMA-262) makes it necessary, until someone can go through ECMA-262 and prove that using the MV version exclusively would be unobservable. If this turns out to really be redundant, then removing it will by definition be an unobservable change.
fa93df2
to
fbe7ef0
Compare
@Aditi-1400 One last thing, would you mind removing |
Also, please squash into one commit please! |
fbe7ef0
to
cd3ec37
Compare
For future reference, this PR achieved consensus at the March 2023 TC39 meeting. |
This PR fixes issue #2315, by redefining following Date operations to calculate in mathematical values instead of Number values:
These operations would be unified when tc39/ecma262#1087 is fixed