Skip to content

Commit a72de40

Browse files
committed
Fix IDs; move AOs
1 parent de625f4 commit a72de40

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

spec.emu

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -882,43 +882,7 @@ contributors: Google, Ecma International
882882
</emu-table>
883883
</emu-clause>
884884

885-
<emu-clause id="sup-temporal-nonisodateadd" type="implementation-defined abstract operation">
886-
<h1>
887-
NonISODateAdd (
888-
_calendar_: a calendar type that is not *"iso8601"*,
889-
_isoDate_: an ISO Date Record,
890-
_duration_: a Date Duration Record,
891-
_overflow_: ~constrain~ or ~reject~,
892-
): either a normal completion containing an ISO Date Record or a throw completion
893-
</h1>
894-
<dl class="header">
895-
<dt>description</dt>
896-
<dd>
897-
The operation performs implementation-defined processing to add _duration_ to _date_ in the context of the calendar represented by _calendar_ and returns the corresponding day, month and year of the result in the ISO 8601 calendar values as an ISO Date Record.
898-
It may throw a *RangeError* exception if _overflow_ is ~reject~ and the resulting month or day would need to be clamped in order to form a valid date in _calendar_.
899-
</dd>
900-
</dl>
901-
<p>The behaviour is implementation-defined, but all calendars follow the general steps given here, which is a generalization of the precise algorithm specified in CalendarDateAdd for *"iso8601"*.</p>
902-
<p>This definition supersedes the definition provided in <emu-xref href="#sec-temporal-nonisodateadd"></emu-xref>.</p>
903-
<p>It performs the following steps when called:</p>
904-
<emu-alg>
905-
1. Let _parts_ be CalendarISOToDate(_calendar_, _isoDate_).
906-
1. Let _yearMonth_ be RegulateNonISOYearMonth(_calendar_, _parts_.[[Year]], _parts_.[[MonthCode]], _duration_.[[Years]]).
907-
1. Let _endOfMonth_ be BalanceNonISODate(_calendar_, _yearMonth_.[[Year]], _yearMonth_.[[Month]] + _duration_.[[Months]] + 1, 0).
908-
1. Let _baseDay_ be _parts_.[[Day]].
909-
1. If _endOfMonth_.[[Day]] &lt; _baseDay_, then
910-
1. If _overflow_ is ~reject~, throw a *RangeError* exception.
911-
1. Let _regulatedDay_ be _endOfMonth_.[[Day]].
912-
1. Else,
913-
1. Let _regulatedDay_ be _baseDay_.
914-
1. Let _balancedDate_ be BalanceNonISODate(_calendar_, _endOfMonth_.[[Year]], _endOfMonth_.[[Month]], _regulatedDay_ + 7 * _duration_.[[Weeks]] + _duration_.[[Days]]).
915-
1. Let _result_ be ? CalendarDateArithmeticalToISO(_calendar_, _balancedDate_.[[Year]], _balancedDate_.[[Month]], _balancedDate_.[[Day]]).
916-
1. If ISODateWithinLimits(_result_) is *false*, throw a *RangeError* exception.
917-
1. Return _result_.
918-
</emu-alg>
919-
</emu-clause>
920-
921-
<emu-clause id="sup-temporal-parsemonthcode" type="implementation-defined abstract operation">
885+
<emu-clause id="sec-temporal-parsemonthcode" type="implementation-defined abstract operation">
922886
<h1>
923887
ParseMonthCode (
924888
_monthCode_: a String,
@@ -943,7 +907,7 @@ contributors: Google, Ecma International
943907
</emu-alg>
944908
</emu-clause>
945909

946-
<emu-clause id="sup-temporal-createmonthcode" type="implementation-defined abstract operation">
910+
<emu-clause id="sec-temporal-createmonthcode" type="implementation-defined abstract operation">
947911
<h1>
948912
CreateMonthCode (
949913
_number_: an integer,
@@ -966,7 +930,7 @@ contributors: Google, Ecma International
966930
</emu-alg>
967931
</emu-clause>
968932

969-
<emu-clause id="sup-temporal-monthcodetoarithmeticalmonth" type="implementation-defined abstract operation">
933+
<emu-clause id="sec-temporal-monthcodetoarithmeticalmonth" type="implementation-defined abstract operation">
970934
<h1>
971935
MonthCodeToArithmeticalMonth (
972936
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1004,7 +968,7 @@ contributors: Google, Ecma International
1004968
</emu-alg>
1005969
</emu-clause>
1006970

1007-
<emu-clause id="sup-temporal-calendardatearithmeticaltoiso" type="implementation-defined abstract operation">
971+
<emu-clause id="sec-temporal-calendardatearithmeticaltoiso" type="implementation-defined abstract operation">
1008972
<h1>
1009973
CalendarDateArithmeticalToISO (
1010974
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1026,7 +990,7 @@ contributors: Google, Ecma International
1026990
</emu-alg>
1027991
</emu-clause>
1028992

1029-
<emu-clause id="sup-temporal-calendardaysinmonth" type="implementation-defined abstract operation">
993+
<emu-clause id="sec-temporal-calendardaysinmonth" type="implementation-defined abstract operation">
1030994
<h1>
1031995
CalendarDaysInMonth (
1032996
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1046,7 +1010,7 @@ contributors: Google, Ecma International
10461010
</emu-alg>
10471011
</emu-clause>
10481012

1049-
<emu-clause id="sup-temporal-calendarmonthsinyear" type="implementation-defined abstract operation">
1013+
<emu-clause id="sec-temporal-calendarmonthsinyear" type="implementation-defined abstract operation">
10501014
<h1>
10511015
CalendarMonthsInYear (
10521016
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1065,7 +1029,7 @@ contributors: Google, Ecma International
10651029
</emu-alg>
10661030
</emu-clause>
10671031

1068-
<emu-clause id="sup-temporal-regulatenonisoyearmonth" type="implementation-defined abstract operation">
1032+
<emu-clause id="sec-temporal-regulatenonisoyearmonth" type="implementation-defined abstract operation">
10691033
<h1>
10701034
RegulateNonISOYearMonth (
10711035
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1108,7 +1072,7 @@ contributors: Google, Ecma International
11081072
</emu-alg>
11091073
</emu-clause>
11101074

1111-
<emu-clause id="sup-temporal-balancenonisodate" type="implementation-defined abstract operation">
1075+
<emu-clause id="sec-temporal-balancenonisodate" type="implementation-defined abstract operation">
11121076
<h1>
11131077
BalanceNonISODate (
11141078
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1159,7 +1123,7 @@ contributors: Google, Ecma International
11591123
</emu-alg>
11601124
</emu-clause>
11611125

1162-
<emu-clause id="sup-temporal-nonisodatesurpasses" type="implementation-defined abstract operation">
1126+
<emu-clause id="sec-temporal-nonisodatesurpasses" type="implementation-defined abstract operation">
11631127
<h1>
11641128
NonISODateSurpasses (
11651129
_calendar_: a calendar type that is not *"iso8601"*,
@@ -1209,6 +1173,42 @@ contributors: Google, Ecma International
12091173
</emu-alg>
12101174
</emu-clause>
12111175

1176+
<emu-clause id="sup-temporal-nonisodateadd" type="implementation-defined abstract operation">
1177+
<h1>
1178+
NonISODateAdd (
1179+
_calendar_: a calendar type that is not *"iso8601"*,
1180+
_isoDate_: an ISO Date Record,
1181+
_duration_: a Date Duration Record,
1182+
_overflow_: ~constrain~ or ~reject~,
1183+
): either a normal completion containing an ISO Date Record or a throw completion
1184+
</h1>
1185+
<dl class="header">
1186+
<dt>description</dt>
1187+
<dd>
1188+
The operation performs implementation-defined processing to add _duration_ to _date_ in the context of the calendar represented by _calendar_ and returns the corresponding day, month and year of the result in the ISO 8601 calendar values as an ISO Date Record.
1189+
It may throw a *RangeError* exception if _overflow_ is ~reject~ and the resulting month or day would need to be clamped in order to form a valid date in _calendar_.
1190+
</dd>
1191+
</dl>
1192+
<p>The behaviour is implementation-defined, but all calendars follow the general steps given here, which is a generalization of the precise algorithm specified in CalendarDateAdd for *"iso8601"*.</p>
1193+
<p>This definition supersedes the definition provided in <emu-xref href="#sec-temporal-nonisodateadd"></emu-xref>.</p>
1194+
<p>It performs the following steps when called:</p>
1195+
<emu-alg>
1196+
1. Let _parts_ be CalendarISOToDate(_calendar_, _isoDate_).
1197+
1. Let _yearMonth_ be RegulateNonISOYearMonth(_calendar_, _parts_.[[Year]], _parts_.[[MonthCode]], _duration_.[[Years]]).
1198+
1. Let _endOfMonth_ be BalanceNonISODate(_calendar_, _yearMonth_.[[Year]], _yearMonth_.[[Month]] + _duration_.[[Months]] + 1, 0).
1199+
1. Let _baseDay_ be _parts_.[[Day]].
1200+
1. If _endOfMonth_.[[Day]] &lt; _baseDay_, then
1201+
1. If _overflow_ is ~reject~, throw a *RangeError* exception.
1202+
1. Let _regulatedDay_ be _endOfMonth_.[[Day]].
1203+
1. Else,
1204+
1. Let _regulatedDay_ be _baseDay_.
1205+
1. Let _balancedDate_ be BalanceNonISODate(_calendar_, _endOfMonth_.[[Year]], _endOfMonth_.[[Month]], _regulatedDay_ + 7 * _duration_.[[Weeks]] + _duration_.[[Days]]).
1206+
1. Let _result_ be ? CalendarDateArithmeticalToISO(_calendar_, _balancedDate_.[[Year]], _balancedDate_.[[Month]], _balancedDate_.[[Day]]).
1207+
1. If ISODateWithinLimits(_result_) is *false*, throw a *RangeError* exception.
1208+
1. Return _result_.
1209+
</emu-alg>
1210+
</emu-clause>
1211+
12121212
<emu-clause id="sup-temporal-nonisodateuntil" type="implementation-defined abstract operation">
12131213
<h1>
12141214
NonISODateUntil (

0 commit comments

Comments
 (0)