Skip to content

Commit a1c5d61

Browse files
anbaMs2ger
authored andcommitted
Editorial: Add explicit step to reject too large dates in ToTemporalYearMonth
The call to `CalendarYearMonthFromFields` will already reject too large dates, but adding an explicit step makes it more obvious that `ISODateToFields` doesn't require support for mapping large ISO dates to calendar dates. And it also aligns `ToTemporalYearMonth` with `ToTemporalMonthDay` after #3054.
1 parent 58fd7de commit a1c5d61

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spec/plainyearmonth.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ <h1>
480480
1. Let _resolvedOptions_ be ? GetOptionsObject(_options_).
481481
1. Perform ? GetTemporalOverflowOption(_resolvedOptions_).
482482
1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]).
483+
1. If ISOYearMonthWithinLimits(_isoDate_) is *false*, throw a *RangeError* exception.
483484
1. Set _result_ to ISODateToFields(_calendar_, _isoDate_, ~year-month~).
484485
1. NOTE: The following operation is called with ~constrain~ regardless of the value of _overflow_, in order for the calendar to store a canonical value in the [[Day]] field of the [[ISODate]] internal slot of the result.
485486
1. Set _isoDate_ to ? CalendarYearMonthFromFields(_calendar_, _result_, ~constrain~).

0 commit comments

Comments
 (0)