You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. If goal is TemporalMonthDayString and parseResult does not contain a DateYear Parse Node, then
a. Assert: goal is the last element of allowedFormats.
b. Set yearAbsent to true.
In the PlainMonthDay/from/argument-propertybag-calendar-iso-string.js test262 test, we create a Temporal.PlainMonthDay of the form:
1. Let parseResult be Completion(ParseISODateTime(string, « TemporalDateTimeString[+Zoned], TemporalDateTimeString[~Zoned], TemporalInstantString, TemporalTimeString, TemporalMonthDayString, TemporalYearMonthString »)).
So the last item in allowedFormats is TemporalYearMonthString. However, the calendar string "01-01" can be parsed as a TemporalMonthDayString, and in that case, the DateYear parse node will be empty. We will then fail the assertion that the parsed goal is the last allowed format.
The text was updated successfully, but these errors were encountered:
I agree with this reading, thanks for catching it. This is a regression from ce94055. It could be that we need to swap the order of TemporalYearMonthString and TemporalMonthDayString in ParseTemporalCalendarString and ParseTemporalTimeZoneString, but on the other hand I'm not sure I remember what the assertion is guaranteeing in the first place. Maybe it was to ensure that the yearAbsent code path is only hit in cases where a month-day string is really supposed to be accepted?
In ParseISODateTime, step 4.a.ii.4 states:
In the
PlainMonthDay/from/argument-propertybag-calendar-iso-string.js
test262 test, we create aTemporal.PlainMonthDay
of the form:Since
calendar
is a String, we enter ParseTemporalCalendarString. Its first step is:So the last item in
allowedFormats
isTemporalYearMonthString
. However, the calendar string "01-01" can be parsed as aTemporalMonthDayString
, and in that case, theDateYear
parse node will be empty. We will then fail the assertion that the parsed goal is the last allowed format.The text was updated successfully, but these errors were encountered: