diff --git a/spec/plainmonthday.html b/spec/plainmonthday.html index fb42af389..f9cb40036 100644 --- a/spec/plainmonthday.html +++ b/spec/plainmonthday.html @@ -307,12 +307,12 @@

1. Set _calendar_ to ? CanonicalizeCalendar(_calendar_). 1. Let _resolvedOptions_ be ? GetOptionsObject(_options_). 1. Perform ? GetTemporalOverflowOption(_resolvedOptions_). - 1. If _result_.[[Year]] is ~empty~, then - 1. Assert: _calendar_ is *"iso8601"*. + 1. If _calendar_ is *"iso8601"*, then 1. Let _referenceISOYear_ be 1972 (the first ISO 8601 leap year after the epoch). 1. Let _isoDate_ be CreateISODateRecord(_referenceISOYear_, _result_.[[Month]], _result_.[[Day]]). 1. Return ! CreateTemporalMonthDay(_isoDate_, _calendar_). 1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]). + 1. If ISODateWithinLimits(_isoDate_) is *false*, throw a *RangeError* exception. 1. Set _result_ to ISODateToFields(_calendar_, _isoDate_, ~month-day~). 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 [[Year]] field of the [[ISODate]] internal slot of the result. 1. Set _isoDate_ to ? CalendarMonthDayFromFields(_calendar_, _result_, ~constrain~). diff --git a/spec/plainyearmonth.html b/spec/plainyearmonth.html index 323d55261..41c3da74f 100644 --- a/spec/plainyearmonth.html +++ b/spec/plainyearmonth.html @@ -477,10 +477,11 @@

1. Let _calendar_ be _result_.[[Calendar]]. 1. If _calendar_ is ~empty~, set _calendar_ to *"iso8601"*. 1. Set _calendar_ to ? CanonicalizeCalendar(_calendar_). - 1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]). - 1. Set _result_ to ISODateToFields(_calendar_, _isoDate_, ~year-month~). 1. Let _resolvedOptions_ be ? GetOptionsObject(_options_). 1. Perform ? GetTemporalOverflowOption(_resolvedOptions_). + 1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]). + 1. If ISOYearMonthWithinLimits(_isoDate_) is *false*, throw a *RangeError* exception. + 1. Set _result_ to ISODateToFields(_calendar_, _isoDate_, ~year-month~). 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. 1. Set _isoDate_ to ? CalendarYearMonthFromFields(_calendar_, _result_, ~constrain~). 1. Return ! CreateTemporalYearMonth(_isoDate_, _calendar_).