Skip to content

Commit

Permalink
Editorial: Rename ResolveISOMonth → ISOResolveMonth
Browse files Browse the repository at this point in the history
This is an editorial change intended to reduce the diff of PR #2500, where
this rename is part of the changes.
  • Loading branch information
ptomato committed May 19, 2023
1 parent 8ab5181 commit 53a7f2d
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions spec/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -830,12 +830,18 @@ <h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-temporal-resolveisomonth" aoid="ResolveISOMonth">
<h1>ResolveISOMonth ( _fields_ )</h1>
<p>
The abstract operation ResolveISOMonth merges the `month` and `monthCode` properties of the given _fields_ Object into an integer month, and validates that they match.
It returns the integer month.
</p>
<emu-clause id="sec-temporal-isoresolvemonth" type="abstract operation">
<h1>
ISOResolveMonth (
_fields_: an Object,
): either a normal completion containing an integer or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>
It validates that the *"month"* and *"monthCode"* properties of the given _fields_ are not inconsistent and merges them into an integer month which is returned, or throws an exception if both are *undefined*.
</dd>
</dl>
<emu-alg>
1. Assert: _fields_ is an ordinary object with no more and no less than the own data properties listed in <emu-xref href="#table-temporal-field-requirements"></emu-xref>.
1. Let _month_ be ! Get(_fields_, *"month"*).
Expand All @@ -844,7 +850,8 @@ <h1>ResolveISOMonth ( _fields_ )</h1>
1. If _monthCode_ is *undefined*, then
1. If _month_ is *undefined*, throw a *TypeError* exception.
1. Return ℝ(_month_).
1. Assert: Type(_monthCode_) is String.
1. Assert: _monthCode_ is a String.
1. NOTE: The ISO 8601 calendar does not include leap months.
1. If the length of _monthCode_ is not 3, throw a *RangeError* exception.
1. If the first code unit of _monthCode_ is not 0x004D (LATIN CAPITAL LETTER M), throw a *RangeError* exception.
1. Let _monthCodeDigits_ be the substring of _monthCode_ from 1.
Expand All @@ -866,7 +873,7 @@ <h1>ISODateFromFields ( _fields_, _overflow_ )</h1>
1. Assert: _overflow_ is either *"constrain"* or *"reject"*.
1. Let _year_ be ! Get(_fields_, *"year"*).
1. Assert: Type(_year_) is Number.
1. Let _month_ be ? ResolveISOMonth(_fields_).
1. Let _month_ be ? ISOResolveMonth(_fields_).
1. Let _day_ be ! Get(_fields_, *"day"*).
1. Assert: Type(_day_) is Number.
1. Return ? RegulateISODate(ℝ(_year_), _month_, ℝ(_day_), _overflow_).
Expand All @@ -884,7 +891,7 @@ <h1>ISOYearMonthFromFields ( _fields_, _overflow_ )</h1>
1. Assert: _overflow_ is either *"constrain"* or *"reject"*.
1. Let _year_ be ! Get(_fields_, *"year"*).
1. Assert: Type(_year_) is Number.
1. Let _month_ be ? ResolveISOMonth(_fields_).
1. Let _month_ be ? ISOResolveMonth(_fields_).
1. Let _result_ be ? RegulateISOYearMonth(ℝ(_year_), _month_, _overflow_).
1. Return the Record {
[[Year]]: _result_.[[Year]],
Expand All @@ -907,7 +914,7 @@ <h1>ISOMonthDayFromFields ( _fields_, _overflow_ )</h1>
1. Let _year_ be ! Get(_fields_, *"year"*).
1. If _month_ is not *undefined*, and _monthCode_ and _year_ are both *undefined*, then
1. Throw a *TypeError* exception.
1. Set _month_ to ? ResolveISOMonth(_fields_).
1. Set _month_ to ? ISOResolveMonth(_fields_).
1. Let _day_ be ! Get(_fields_, *"day"*).
1. Assert: Type(_day_) is Number.
1. Let _referenceISOYear_ be 1972 (the first leap year after the Unix epoch).
Expand Down

0 comments on commit 53a7f2d

Please sign in to comment.