Skip to content

Commit d83241f

Browse files
Manishearthsffc
andauthored
Correctly disallow calendared monthday/yearmonth strings whilst still allowing calendared datetime strings (#3133)
* Correctly disallow calendared monthday/yearmonth strings whilst still allowing calendared datetime strings * Update spec/abstractops.html Co-authored-by: Shane F. Carr <[email protected]> --------- Co-authored-by: Shane F. Carr <[email protected]>
1 parent fa3d0b9 commit d83241f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/abstractops.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,11 @@ <h1>
15031503
1. If _annotation_ contains an |AnnotationCriticalFlag| Parse Node, or _calendarWasCritical_ is *true*, throw a *RangeError* exception.
15041504
1. Else,
15051505
1. If _annotation_ contains an |AnnotationCriticalFlag| Parse Node, throw a *RangeError* exception.
1506-
1. If _goal_ is |TemporalMonthDayString| or |TemporalYearMonthString|, _calendar_ is not ~empty~, and the ASCII-lowercase of _calendar_ is not *"iso8601"*, throw a *RangeError* exception.
1507-
1. If _goal_ is |TemporalMonthDayString| and _parseResult_ does not contain a |DateYear| Parse Node, set _yearAbsent_ to *true*.
1506+
1. If _goal_ is |TemporalYearMonthString| and _parseResult_ does not contain a |DateDay| Parse Node, then
1507+
1. If _calendar_ is not ~empty~ and the ASCII-lowercase of _calendar_ is not *"iso8601"*, throw a *RangeError* exception.
1508+
1. If _goal_ is |TemporalMonthDayString| and _parseResult_ does not contain a |DateYear| Parse Node, then
1509+
1. If _calendar_ is not ~empty~ and the ASCII-lowercase of _calendar_ is not *"iso8601"*, throw a *RangeError* exception.
1510+
1. Set _yearAbsent_ to *true*.
15081511
1. If _parseResult_ is not a Parse Node, throw a *RangeError* exception.
15091512
1. NOTE: Applications of StringToNumber below do not lose precision, since each of the parsed values is guaranteed to be a sufficiently short string of decimal digits.
15101513
1. Let each of _year_, _month_, _day_, _hour_, _minute_, _second_, and _fSeconds_ be the source text matched by the respective |DateYear|, |DateMonth|, |DateDay|, the first |Hour|, the first |MinuteSecond|, |TimeSecond|, and the first |TemporalDecimalFraction| Parse Node contained within _parseResult_, or an empty sequence of code points if not present.

0 commit comments

Comments
 (0)