-
Notifications
You must be signed in to change notification settings - Fork 156
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
Various issues and bugs #1502
Comments
Thanks, this is incredibly comprehensive and helpful. Some of these are probably already covered by #1411, #1413, #1424, and #1425, so I'll work on those first. Then what's left I'll separate into editorial and normative changes, fix the editorial ones, and prepare a consensus PR for the normative ones. |
@anba - Really impressive feedback. Thanks for this! |
5.5.11 DifferenceISODateTime
|
Hi @wirthi, please file a new issue. |
If you prefer I can do that. I thought it would be a good idea to collect the issues here in one place, doesn't that make it easier for the editors as well? I ran into many of the same issues that @anba reported as well, so I just wanted to amend the list here. |
I prefer that, that's why I asked. |
Can the "hours is undefined" branch not happen in ParseTemporalTimeZoneString in this case? |
ParseTemporalInstant calls ParseTemporalInstantString and ParseTemporalInstantString checks the input matches TemporalInstantString. TemporalInstantString has TimeZoneOffsetRequired and therefore the "hours is undefined" branch can't happen. |
Verify that everything from the checklist is resolved, open separate issues for anything that's left. |
Feedback from an implementation asked for clarification on this. It's not possible to directly create a PlainYearMonth or PlainMonthDay given a full date in a non-ISO calendar. To create it directly, you need the ISO date of the first day of the PlainYearMonth, or the ISO date of the PlainMonthDay in the reference year, respectively. Only the calendar has this knowledge. (For example, today's date 2023-01-05 in the Hebrew calendar is 12 Tevet 5783. If you want the PlainYearMonth of Tevet 5783, you need to create it with a reference ISO date of 2022-12-25. This is accomplished by the CalendarYearMonthFromFields call, where _fields_ is something like `{ year: 5783, monthCode: 'M04' }`.) See: #1502
It's not possible to directly create a PlainYearMonth or PlainMonthDay given a full date in a non-ISO calendar. To create it directly, you need the ISO date of the first day of the PlainYearMonth, or the ISO date of the PlainMonthDay in the reference year, respectively. Only the calendar has this knowledge. (For example, today's date 2023-01-05 in the Hebrew calendar is 12 Tevet 5783. If you want the PlainYearMonth of Tevet 5783, you need to create it with a reference ISO date of 2022-12-25. This is accomplished by the CalendarFields / CalendarYearMonthFromFields calls in toPlainYearMonth, where fields is something like
This is by design, see #741 (comment) and #2057.
Similar to the question about toPlainYearMonth/toPlainMonthDay, this is so that the reference ISO date is set consistently. result.[[Day]] is user input and may not be the correct reference value. See #1316. (There are already clarifying notes about this step in the spec text, so I think no further action is needed here.)
That wouldn't be correct, because PlainYearMonth internal slots must be allowed to contain a reference date that's outside the limits for ISODateTimeWithinLimits. e.g.,
I believe this is a typo! I opened a new issue for it: #2457
Same as above, see #1316.
Sure, done in #2459.
year is validated by the call to PrepareTemporalFields in step 2.
That's by design, the returned record should have the canonical reference year for the ISO calendar of 1972.
I believe this has been fixed in the current DefaultMergeCalendarFields.
(1) is solved, it's no longer possible to create infinite rounding increments. I've opened an issue to discuss the other two points: #2458
Duplicate of #2190. |
That leaves everything in the checklist either addressed, or with a separate issue open; I'll close this. |
Some context: all calendars (not just ISO) canonicalize the reference year in This is helpful because it makes d1 = Temporal.PlainMonthDay.from('2000-01-01[u-ca=chinese]')
// => 1972-01-11[u-ca=chinese
anotherYear = d1.toPlainDate({year: 2001}).toString()
// => '2002-01-08[u-ca=chinese]'
d2 = Temporal.PlainMonthDay.from(anotherYear)
// => 1972-01-11[u-ca=chinese]
d2.equals(d1)
// => true Note that the canonical year is not always 1972 for some dates and non-ISO calendars, because for some calendars leap days or (for lunisolar calendars) leap months don't exist in 1972. It's not specified how the canonical year should be chosen, only that it must be deterministic based on the month/day inputs. In the polyfill, we start at 1972 and walk backwards one year at a time until we find a year where that month/day exists in that calendar. PlainYearMonth works the same way, but it's easier because the ReferenceDay is always canonicalized to @ptomato - The relevant PR is #1331 that outlines the requirements above for ISO, but did we ever add the corresponding non-ISO requirements to either the Temporal spec or the 402 spec? I don't remember where the responsibility for specifying non-ISO calendar behavior ended up. |
Good catch. In fact, this is not specified in Temporal.Calendar.prototype.yearMonthFromFields and Temporal.Calendar.prototype.monthDayFromFields. It's a bit unwieldy that both of these go through CalendarDateToISO whereas what we really need to specify is that yearMonthFromFields returns an ISO date corresponding to the 1st of the calendar month, and monthDayFromFields picks a reference year. I've opened #2461 for this. |
Feedback from an implementation asked for clarification on this. It's not possible to directly create a PlainYearMonth or PlainMonthDay given a full date in a non-ISO calendar. To create it directly, you need the ISO date of the first day of the PlainYearMonth, or the ISO date of the PlainMonthDay in the reference year, respectively. Only the calendar has this knowledge. (For example, today's date 2023-01-05 in the Hebrew calendar is 12 Tevet 5783. If you want the PlainYearMonth of Tevet 5783, you need to create it with a reference ISO date of 2022-12-25. This is accomplished by the CalendarYearMonthFromFields call, where _fields_ is something like `{ year: 5783, monthCode: 'M04' }`.) See: #1502
Some issues I found while prototyping Temporal for SM. Non-exhaustive list (I've omitted most "?" / "!" errors, spelling mistakes, etc.):
2.2.4 SystemDateTime ( [ temporalTimeZoneLike [ , calendarLike ] ] )
2.2.5 SystemZonedDateTime ( [ temporalTimeZoneLike [ , calendarLike ] ] )
undefined
.3.3.19 Temporal.PlainDate.prototype.add ( temporalDurationLike [ , options ] )
3.3.20 Temporal.PlainDate.prototype.subtract ( temporalDurationLike [ , options ] )
RejectDurationSign
is a no-op afterToLimitedTemporalDuration
. Either removeRejectDurationSign
or change toAssert: ValidateTemporalDuration(...) is true
.GetOptionsObject
andCreateTemporalDuration
not consistent.add
callsCreateTemporalDuration
and thenGetOptionsObject
.subtract
callsGetOptionsObject
and thenCreateTemporalDuration
.3.5.2 ToTemporalDate ( item [ , options ] )
ValidateISODate
should either be removed or changed to assertion, becauseParseTemporalDateString
always returns a valid date viaParseISODateTime
.RegulateISODate
is a no-op on a valid date, so this call should be removed.3.5.3 DifferenceISODate ( y1, m1, d1, y2, m2, d2, largestUnit )
mid.[[Year]] is equal to mid.[[Year]]
comparison it obviously incorrect.AddISODate
.3.5.6 RejectISODate ( year, month, day )
RejectISODate
has only two uses. These should inlineRejectISODate
, because explicitly callingValidateISODate
for error checking is more common throughout the spec.4.3.10 Temporal.PlainTime.prototype.add ( temporalDurationLike )
4.3.11 Temporal.PlainTime.prototype.subtract ( temporalDurationLike )
RejectDurationSign
is a no-op afterToLimitedTemporalDuration
. Either removeRejectDurationSign
or change toAssert: ValidateTemporalDuration(...) is true
.AddTime
returns a balanced time, which makesRegulateTime
a no-op. Either remove or change to changeAssert: ValidateTime(...)
.CreateTemporalTime
is infallible, so should be prefixed with "!" instead of "?".OrdinaryCreateFromConstructor
is fallible4.3.18 Temporal.PlainTime.prototype.toZonedDateTime ( item )
item
is not an object, cf.Get
calls.4.3.19 Temporal.PlainTime.prototype.getISOFields ( )
this
value check to be a PlainTime object.4.5.2 ToTemporalTime ( item [ , overflow ] )
ParseTemporalTimeString
doesn't have a [[Calendar]] field.ValidateTime
check never throws, becauseParseTemporalTimeString
only returns valid times viaParseISODateTime
.CreateTemporalTime
is infallible, so should use "!" instead of "?".OrdinaryCreateFromConstructor
is fallible4.5.3 ToPartialTime ( temporalTimeLike )
temporalTimeLike
being an Object, so step 1 should be changed to an assertion.4.5.4 RegulateTime ( hour, minute, second, millisecond, microsecond, nanosecond, overflow )
5.3.41 Temporal.PlainDateTime.prototype.getISOFields ( )
5.3.26 Temporal.PlainDateTime.prototype.add ( temporalDurationLike [ , options ] )
5.3.27 Temporal.PlainDateTime.prototype.subtract ( temporalDurationLike [ , options ] )
RejectDurationSign
is a no-op afterToLimitedTemporalDuration
. Either removeRejectDurationSign
or change toAssert: ValidateTemporalDuration(...) is true
.5.3.30 Temporal.PlainDateTime.prototype.round ( options )
GetOptionsObject
is a no-op after the type check foroptions
, so the call should be removed.5.3.31 Temporal.PlainDateTime.prototype.equals ( other )
CompareISODateTime
to avoid duplicating steps for date-time comparison.5.5.1 GetEpochFromISOParts ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond )
MakeDay
uses a zero-indexed month value, i.e.month - 1
must be passed to it.MakeDate
can return NaN for large year values, becauseMakeDay
has wishy-washy definition when NaN can be returned for large values: (Review MakeDay/MakeDate/TimeFromYear callers for possibly out-of-range values #2315)GetEpochFromISOParts
is called fromISODateTimeWithinLimits
, so I think the best way to avoid this issue, is to avoid callingGetEpochFromISOParts
inISODateTimeWithinLimits
and instead manually check for the date-time limits, i.e. the two dates "-271821-04-20" and "+275760-09-13".5.5.2 ISODateTimeWithinLimits ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond )
5.5.4 ToTemporalDateTime ( item [ , options ] )
InterpretTemporalDateTimeFields
doesn't return a [[Calendar]] field, which makesToOptionalTemporalCalendar(result.[[Calendar]])
invalid.ValidateISODateTime
should either be removed or changed to assertion, becauseParseTemporalDateTimeString
always returns a valid date-time viaParseISODateTime
.5.5.5 ValidateISODateTime ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond )
ValidateISODate
instead of duplicating the same steps.5.5.10 AddDateTime ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond, calendar, years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds, options )
CreateTemporalDuration
.5.5.9 CompareISODateTime ( y1, mon1, d1, h1, min1, s1, ms1, mus1, ns1, y2, mon2, d2, h2, min2, s2, ms2, mus2, ns2 )
CompareISODate
andCompareTemporalTime
to avoid repeating the same steps multiple times.5.5.12 DifferenceISODateTime ( y1, mon1, d1, h1, min1, s1, ms1, mus1, ns1, y2, mon2, d2, h2, min2, s2, ms2, mus2, ns2, calendar, largestUnit [ , options ] )
calendar
argument inCreateTemporalDate
calls.LargerOfTwoTemporalDurationUnits
misspelled asLargerOfTwoTemporalUnits
.5.5.11 RoundISODateTime ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond, increment, unit, roundingMode [ , dayLength ] )
dayLength
parameter not correctly handled in call toRoundTime
.6.3.32 Temporal.ZonedDateTime.prototype.withPlainDate ( plainDateLike )
GetISO8601Calendar()
, but doesn't use the returned calendar anywhere.6.3.39 Temporal.ZonedDateTime.prototype.round ( options )
GetOptionsObject
is a no-op after the type check foroptions
, so the call should be removed.fallback
argument inToTemporalRoundingMode
call.dayLengthNs
is non-zero, otherwise we later end up with a division through zero.dayLengthNs
values. (Normative: Disallow negative day lengths #2261)6.5.4 TemporalZonedDateTimeToString ( zonedDateTime, precision, showCalendar, showTimeZone, showOffset [ , increment, unit, roundingMode ] )
ToString(zonedDateTime.[[Calendar]])
is unconditionally executed whereasToString(timeZone)
is only conditionally executed. This should be harmonised. (Normative: AvoidToString(calendar)
when the calendar-id is unused #2269)6.5.5 AddZonedDateTime ( epochNanoseconds, timeZone, calendar, years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds, options )
options
parameter.6.5.6 DifferenceZonedDateTime ( ns1, ns2, timeZone, calendar, largestUnit [ , options ] )
options
parameter may not be present, so it can't be passed unconditionally toDifferenceISODateTime()
.options
to this operation, so it should probably be removed.ns2 - ns1
and then testing for zero.6.5.7 NanosecondsToDays ( nanoseconds, relativeTo )
relativeTo
being an Object before checking for internal slots.modulo
implies the result is always positive, cf. definition of themodulo
operation.abs(r.[[DayLength]])
. NanosecondsToDays should be changed to return a non-negative [[DayLength]].6.3.35 Temporal.ZonedDateTime.prototype.add ( temporalDurationLike [ , options ] )
6.3.36 Temporal.ZonedDateTime.prototype.subtract ( temporalDurationLike [ , options ] )
RejectDurationSign
is a no-op afterToLimitedTemporalDuration
. Either removeRejectDurationSign
or change toAssert: ValidateTemporalDuration(...) is true
.6.3.50 Temporal.ZonedDateTime.prototype.toPlainYearMonth ( )
6.3.51 Temporal.ZonedDateTime.prototype.toPlainMonthDay ( )
YearMonthFromFields
resp.MonthDayFromFields
when for exampletoPlainDate
,toPlainTime
, andtoPlainDateTime
can directly create the result object.7.3.21 Temporal.Duration.prototype.total ( options )
options
parameter should be mandatory instead of being coerced throughGetOptionsObject()
, because step 6 will otherwise always throw an error anyway.7.3.21 Temporal.Duration.prototype.total ( options )
If unit is "nanoseconds"
case is missing.7.5.2 ToTemporalDurationRecord ( temporalDurationLike )
ToNumber()
returns a Number value, butfloor
expects a mathematical value.val
isundefined
,ToNumber(undefined)
returnsNaN
, which meansfloor(NaN) ≠ NaN
will evaluate totrue
when assumingMath.floor()
semantics should be applied. So an absent value will always throw a RangeError.7.5.8 CreateTemporalDuration ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds [ , newTarget ] )
-0
should be normalised to+0
, because currently, depending on which operations are used,-0
may or may not be normalised to+0
.7.5.11 BalanceDuration ( days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds, largestUnit [ , relativeTo ] )
relativeTo
is absent.relativeTo
being an Object before checking for internal slots.nanoseconds < 0
check where other operations defer toSign()
and then apply an extra step to handle theis zero
case. This should be normalised throughout the spec.7.5.12 UnbalanceDurationRelative ( years, months, weeks, days, largestUnit [ , relativeTo ] )
relativeTo
, so it shouldn't be an optional argument.Get(untilResult, "months")
. Otherwise we can't be sure the value is a number.value ≠ 0
instead ofabs(value) > 0
, because the former is more straightforward.7.5.13 BalanceDurationRelative ( years, months, weeks, days, largestUnit, relativeTo )
Get(untilResult, "months")
. Otherwise we can't be sure the value is a number.CalendarDateAdd
avoids repeatedly accessing the "dateAdd" property, but this still happens whenCalendarDateAdd
is called fromMoveRelativeDate
. (Normative: Perform a single "dateAdd" lookup for MoveRelativeDate #2267)dateAdd
parameter toMoveRelativeDate
which can then be passed to theCalendarDateAdd
call inMoveRelativeDate
.7.5.14 AddDuration ( y1, mon1, w1, d1, h1, min1, s1, ms1, mus1, ns1, y2, mon2, w2, d2, h2, min2, s2, ms2, mus2, ns2 [ , relativeTo ] )
relativeTo
parameter is marked as optional, but all callers provide it. So it should be changed to non-optional.ValidateTemporalDuration
misspelled asValidateDuration
.7.5.18 RoundDuration ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds, increment, unit, roundingMode [ , relativeTo ] )
MoveRelativeDate
with PlainDate objects, butMoveRelativeDate
expects itsrelativeTo
parameter to be a PlainDateTimeObject.Perform ? RequireInternalSlot(relativeTo, [[InitializedTemporalDateTime]])
should be an assertion. IfrelativeTo
isn't undefined, it is guaranteed to be either a ZonedDateTime object or a PlainDateTime object.CalendarDateAdd
avoids repeatedly accessing the "dateAdd" property, but this still happens whenCalendarDateAdd
is called fromMoveRelativeDate
. (Normative: Perform a single "dateAdd" lookup for MoveRelativeDate #2267)dateAdd
parameter toMoveRelativeDate
which can then be passed to theCalendarDateAdd
call inMoveRelativeDate
.7.5.21 TemporalDurationToString ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds, precision )
precision
is 0, the completedecimalPart
is added to the result. This is clearly wrong.8.3.7 Temporal.Instant.prototype.add ( temporalDurationLike )
8.3.8 Temporal.Instant.prototype.subtract ( temporalDurationLike )
AddInstant
is fallible, so should be prefixed with "?" instead of "!".RejectDurationSign
is a no-op afterToLimitedTemporalDuration
. Either removeRejectDurationSign
or change toAssert: ValidateTemporalDuration(...) is true
.8.3.11 Temporal.Instant.prototype.round ( options )
options
parameter should be mandatory instead of being coerced throughGetOptionsObject()
, becauseToSmallestTemporalUnit
will end up throwing anyway whenoptions
is undefined.round
functions which always throw an error whenoptions
is absent.8.5.5 ParseTemporalInstant ( isoString )
result.[[TimeZoneOffsetString]]
is neverundefined
, so step 4 should be an assertion.utc - offsetNanoseconds
can result in an invalid instant, but all callers ofParseTemporalInstant
expect the return value is a valid instant. That means there needs to be an explicit check thatutc - offsetNanoseconds
is a valid epoch nanoseconds value.8.5.7 AddInstant ( epochNanoseconds, hours, minutes, seconds, milliseconds, microseconds, nanoseconds )
8.5.10 TemporalInstantToString ( instant, timeZone, precision )
Absolute.prototype.toString(timeZone)
have options to omit the offset or time zone? #741 (comment) andInstant.p.toString
using{timeZone: 'UTC'}
option emits+00:00
offset, notZ
as expected #2057.new Temporal.Instant(0n).toString()
andnew Temporal.Instant(0n).toString({timeZone: "UTC"})
give different results.Absolute.prototype.toString(timeZone)
have options to omit the offset or time zone? #741 (comment) andInstant.p.toString
using{timeZone: 'UTC'}
option emits+00:00
offset, notZ
as expected #2057.9.3.12 Temporal.PlainYearMonth.prototype.add ( temporalDurationLike [ , options ] )
9.3.13 Temporal.PlainYearMonth.prototype.subtract ( temporalDurationLike [ , options ] )
RejectDurationSign
is a no-op afterToLimitedTemporalDuration
. Either removeRejectDurationSign
or change toAssert: ValidateTemporalDuration(...) is true
.CalendarDaysInMonth
can return any value, butCreateTemporalDate
expects an integer.9.3.14 Temporal.PlainYearMonth.prototype.until ( other [ , options ] )
9.3.15 Temporal.PlainYearMonth.prototype.since ( other [ , options ] )
DateFromFields()
expects anoptions
argument, but none is passed.CreateTemporalDuration
called with too few arguments.9.3.21 Temporal.PlainYearMonth.prototype.toPlainDate ( item )
9.5.1 ToTemporalYearMonth ( item [ , options ] )
ParseTemporalYearMonthString
doesn't return a [[Calendar]] field.result.[[Day]] is undefined
condition is never true, becauseParseTemporalYearMonthString
always returns [[Day]] is a number viaParseISODateTime
.CreateTemporalYearMonth
called withyear = undefined
, but must instead be an integer.ValidateISODate
not necessary, because also performed inCreateTemporalYearMonth
.YearMonthFromFields
whenresult.[[Day]]
is defined?from
andwith
must set canonical reference day (for PlainYearMonth) or reference year (for PlainMonthDay) #13169.5.7 CreateTemporalYearMonth ( isoYear, isoMonth, calendar, referenceISODay [ , newTarget ] )
ISODateTimeWithinLimits
to make surereferenceISODay
can't make this is an invalid date-time value.10.1.1 Temporal.PlainMonthDay ( isoMonth, isoDay [ , calendarLike [ , referenceISOYear ] ] )
referenceISOYear is not given
, but elsewhere in the specundefined
checks are preferred.new Temporal.PlainMonthDay(1, 1, undefined)
andnew Temporal.PlainMonthDay(1, 1, undefined, undefined)
are currently spec'ed to return different results.10.5.1 ToTemporalMonthDay ( item [ , options ] )
ParseTemporalMonthDayString
doesn't return a [[Calendar]] field.CreateTemporalMonthDay
called withyear = undefined
, but must instead be an integer.ValidateISODate
not necessary, because also performed inCreateTemporalMonthDay
.result.[[Year]]
not passed toCreateTemporalMonthDay
. → Typo in ToTemporalMonthDay #2457CreateTemporalMonthDay
called with the wrong argument order.MonthDayFromFields
whenresult.[[Year]]
is defined?from
andwith
must set canonical reference day (for PlainYearMonth) or reference year (for PlainMonthDay) #131610.5.2 CreateTemporalMonthDay ( isoMonth, isoDay, calendar, referenceISOYear [ , newTarget ] )
ISODateTimeWithinLimits
to ensure the year has at most six digits, because other parts of the spec assume this is always the case. (Normative: Disallow arbitrary integers for the reference ISO year in PlainMonthDay #2266)10.3.12 Temporal.PlainMonthDay.prototype.toPlainDate ( item )
options
type check in step 6 should be moved to an earlier step for consistency with other methods in the proposal.11.1.1 IsValidTimeZoneName ( timeZone )
11.4.6 Temporal.TimeZone.prototype.getPlainDateTimeFor ( instant [ , calendarLike ] )
RequireInternalSlot
call intentionally omitted? If yes, can we at least require that thethis
value is an object, because as currently spec'ed, it's necessary that bothBuiltinTimeZoneGetPlainDateTimeFor
andGetOffsetNanosecondsFor
accept arbitrary (non-Object!) values.11.4.9 Temporal.TimeZone.prototype.getNextTransition ( startingPoint )
11.4.10 Temporal.TimeZone.prototype.getPreviousTransition ( startingPoint )
CreateTemporalInstant
only accepts valid epoch nanoseconds. That means there needs to be an explicitRejectInstant
call beforeCreateTemporalInstant
. (Normative: Check for invalid epoch nanoseconds in Temporal.TimeZone.prototype.get{Next,Previous}Transition #2311)11.6.1 ParseTemporalTimeZone ( string )
ParseTemporalTimeZoneString
has a [[Name]] field, here incorrectly accessed as [[TimeZoneName]].11.6.2 CreateTemporalTimeZone ( identifier [ , newTarget ] )
CanonicalizeTimeZoneName(identifier)
is incorrect for offset-only time zones.11.6.6 GetIANATimeZoneNextTransition ( epochNanoseconds, timeZoneIdentifier )
11.6.7 GetIANATimeZonePreviousTransition ( epochNanoseconds, timeZoneIdentifier )
null
is a valid return value.11.6.8 ParseTimeZoneOffsetString ( offsetString )
hours
orsign
will ever be undefined, so step 4 should be removed resp. changed into an assertion.11.6.9 FormatTimeZoneOffsetString ( offsetNanoseconds )
floor()
called on negative values, butfloor()
rounds towards +∞. Sofloor(4.3) = 4
, butfloor(-4.3) = -5
. Is this intended here?post
isn't always defined, but unconditionally consumed in the return step.11.6.11 GetOffsetNanosecondsFor ( timeZone, instant )
11.6.12 BuiltinTimeZoneGetOffsetStringFor ( timeZone, instant )
11.6.13 BuiltinTimeZoneGetPlainDateTimeFor ( timeZone, instant, calendar )
11.6.14 BuiltinTimeZoneGetInstantFor ( timeZone, dateTime, disambiguation )
11.6.14 BuiltinTimeZoneGetInstantFor ( timeZone, dateTime, disambiguation )
AddDateTime
incorrectly called: wrong number of arguments andoptions
not passed as an Object.AddDateTime
returns a record, butGetPossibleInstantsFor
expects an object.12.1.2 IsBuiltinCalendar ( id )
12.1.3 GetBuiltinCalendar ( id )
CreateTemporalCalendar
.12.1.6 CalendarMergeFields ( calendar, fields, additionalFields )
12.1.13 CalendarDayOfWeek ( calendar, dateLike )
12.1.14 CalendarDayOfYear ( calendar, dateLike )
12.1.15 CalendarWeekOfYear ( calendar, dateLike )
12.1.16 CalendarDaysInWeek ( calendar, dateLike )
12.1.17 CalendarDaysInMonth ( calendar, dateLike )
12.1.18 CalendarDaysInYear ( calendar, dateLike )
12.1.19 CalendarMonthsInYear ( calendar, dateLike )
12.1.20 CalendarInLeapYear ( calendar, dateLike )
12.1.25 YearMonthFromFields ( calendar, fields, options )
12.1.26 MonthDayFromFields ( calendar, fields, options )
options
argument to these operations.12.1.21 ToTemporalCalendar ( temporalCalendarLike )
ParseTemporalCalendarString
can return a non-supported calendar string, butCreateTemporalCalendar
asserts the input is a supported, built-in calendar string.12.1.37 ResolveISOMonth ( fields )
the substring of monthCode from 1
instead ofthe substring of monthCode from 2
.12.1.40 ISOMonthDayFromFields ( fields, options )
Let result be undefined.
is unnecessary and therefore should be removed.year
not validated whenmonthCode
isundefined
in steps 13-14?year
value.12.1.45 ISOMergeFields ( fields, additionalFields )
If newKeys does not contain either "month" or "monthCode"
is wrong, for examplenew Temporal.PlainMonthDay(1,1).with({day:2})
currently always throws. It should check if the result contains these keys:12.4.19 Temporal.Calendar.prototype.monthsInYear ( dateOrDateTime )
12.4.20 Temporal.Calendar.prototype.inLeapYear ( dateOrDateTime )
temporalDateLike
.13.7 DurationHandleFractions ( fHours, minutes, fMinutes, seconds, fSeconds, milliseconds, fMilliseconds, microseconds, fMicroseconds, nanoseconds, fNanoseconds )
floor()
called on negative values, butfloor()
rounds towards +∞. Sofloor(4.3) = 4
, butfloor(-4.3) = -5
. Is this intended here?13.16 ToTemporalRoundingIncrement ( normalizedOptions, dividend, inclusive )
x / increment
is not defined, because +∞ isn't a mathematical number.Therefore I'd like to propose to limit the maximum rounding increment for "hour", "month", "week", and "day" to reasonable limits.
13.24 ToTemporalDurationTotalUnit ( normalizedOptions )
GetOption
result isundefined
instead of requiring the callers to perform this check.13.26 ToRelativeTemporalObject ( options )
ParseISODateTime
on an arbitrary string, which gives bogus results. Should this beParseTemporalZonedDateTimeString
?13.39 ISO 8601 grammar
CalendarDate
production is unused.13.41 ParseTemporalInstantString ( isoString )
13.42 ParseTemporalZonedDateTimeString ( isoString )
isoString
must be parseable as bothTemporalZonedDateTimeString
andTemporalTimeZoneString
. Is this really intended?TemporalZonedDateTimeString
production should be changed accordingly:timeZoneResult.[[Z]]
is alwaysundefined
, because UTCDesignator isn't allowed in TemporalZonedDateTimeString anyway.ToTemporalZonedDateTime
,ToTemporalZonedDateTime
handles the case when no time zone name is present, but that can't actually happen, cf. the intersection productionTemporalZonedDateTimeString ∩ TemporalInstantString
13.46 ParseTemporalDurationString ( isoString )
DurationHandleFractions
called with too few arguments.13.52 PrepareTemporalFields ( fields, fieldNames, requiredFields )
13.53 PreparePartialTemporalFields ( fields, fieldNames )
fields
being an Object, so step 1 should be changed to an assertion.The text was updated successfully, but these errors were encountered: