Skip to content

Commit

Permalink
Editorial: Add explicit step to reject too large dates in ToTemporalY…
Browse files Browse the repository at this point in the history
…earMonth

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`.
  • Loading branch information
anba committed Dec 9, 2024
1 parent aca124b commit 3ce9a20
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/plainyearmonth.html
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ <h1>
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~).
Expand Down

0 comments on commit 3ce9a20

Please sign in to comment.