Skip to content

Commit

Permalink
Normative: Fix inconsistency in order of observable operations
Browse files Browse the repository at this point in the history
Previously, the monthDayFromFields() method of non-ISO calendars behaved
differently from dateFromFields() and yearMonthFromFields(), checking the
overflow option after accessing the fields whereas the other two checked
the overflow option first.

This normative change fixes this inconsistency.
  • Loading branch information
ptomato committed Aug 15, 2022
1 parent a4728e3 commit 60fc723
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/intl.html
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,8 @@ <h1>Temporal.Calendar.prototype.monthDayFromFields ( _fields_ [ , _options_ ] )<
1. If _calendar_.[[Identifier]] is *"iso8601"*, then
1. Let _result_ be ? ISOMonthDayFromFields(_fields_, _options_).
1. Else,
1. Set _fields_ to ? PrepareTemporalFields(_fields_, « *"day"*, *"era"*, *"eraYear"*, *"month"*, *"monthCode"*, *"year"* », « *"day"* »).
1. Let _overflow_ be ? ToTemporalOverflow(_options_).
1. Set _fields_ to ? PrepareTemporalFields(_fields_, « *"day"*, *"era"*, *"eraYear"*, *"month"*, *"monthCode"*, *"year"* », « *"day"* »).
1. Let _result_ be ? CalendarDateToISO(_calendar_.[[Identifier]], _fields_, _overflow_).
1. Set _result_.[[ReferenceISOYear]] to _result_.[[Year]].
1. Return ? CreateTemporalMonthDay(_result_.[[Month]], _result_.[[Day]], _calendar_, _result_.[[ReferenceISOYear]]).
Expand Down

0 comments on commit 60fc723

Please sign in to comment.