Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Reject too large dates in ToTemporalMonthDay #3054

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/plainmonthday.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ <h1>
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~).
Expand Down
5 changes: 3 additions & 2 deletions spec/plainyearmonth.html
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,11 @@ <h1>
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_).
Expand Down
Loading