-
Notifications
You must be signed in to change notification settings - Fork 149
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
Spec: Throw on undefined calendar in Temporal.now #1391
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1391 +/- ##
=======================================
Coverage 95.36% 95.37%
=======================================
Files 19 19
Lines 11137 11154 +17
Branches 1829 1832 +3
=======================================
+ Hits 10621 10638 +17
Misses 511 511
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a79c751
to
2df1a50
Compare
Should adjust #1392 to match if allowing undefined calendars is what we want; otherwise I'll redo this change to fix the spec to match the polyfill + docs. |
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.
The polyfill and docs are actually correct here, it's a bug in the spec text. (This was probably the one single Temporal issue of the past year on which the most time was spent, so we don't want to get it wrong!)
2df1a50
to
9671145
Compare
Got it. Changed to reflect that! |
9671145
to
b3b4971
Compare
b3b4971
to
c44fa15
Compare
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear.
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear. Common classes of smaller issues fixed: - Examples did not include seconds in string representations - Examples contained extra zeroes of precision when not requested - Old calling conventions used; arguments needed to be changed - Some options bags are now used in dedicated places rather than alongside other methods
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear. Common classes of smaller issues fixed: - Examples did not include seconds in string representations - Examples contained extra zeroes of precision when not requested - Old calling conventions used; arguments needed to be changed - Some options bags are now used in dedicated places rather than alongside other methods
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear. Common classes of smaller issues fixed: - Examples did not include seconds in string representations - Examples contained extra zeroes of precision when not requested - Old calling conventions used; arguments needed to be changed - Some options bags are now used in dedicated places rather than alongside other methods
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear. Common classes of smaller issues fixed: - Examples did not include seconds in string representations - Examples contained extra zeroes of precision when not requested - Old calling conventions used; arguments needed to be changed - Some options bags are now used in dedicated places rather than alongside other methods
Running all the code samples in the docs through a tolerant markdown snippet parser + execution environment revealed many errors. #1395, #1391, #1380, and this patch's one-line fix in plainmonthday.mjs were all bugs revealed by the documentation code samples. Many of the changes in this patch are slight syntactic changes to make the samples testable and more clear. Common classes of smaller issues fixed: - Examples did not include seconds in string representations - Examples contained extra zeroes of precision when not requested - Old calling conventions used; arguments needed to be changed - Some options bags are now used in dedicated places rather than alongside other methods
I found another spec discrepancy while auditing docs code samples, where the docs+polyfill disagree with spec.
Temporal.now.{plainDate,plainDateTime,zonedDateTime}()
should accept undefined calendar because they all delegate to SystemDateTime which usesToOptionalTemporalCalendar
. However, calendarLike isn't listed as an optional argument.Which is the correct behavior? Assuming the spec is correct, this makes the polyfill match and adds some optionality-brackets to the spec for clarity.