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

Editorial: Fix various issues #1560

Merged
merged 12 commits into from
Jun 24, 2021
Merged
12 changes: 6 additions & 6 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ <h1>ToLargestTemporalUnit ( _normalizedOptions_, _disallowedUnits_, _fallback_ [
1. Let _largestUnit_ be ? GetOption(_normalizedOptions_, *"largestUnit"*, « String », « *"auto"*, *"year"*, *"years"*, *"month"*, *"months"*, *"week"*, *"weeks"*, *"day"*, *"days"*, *"hour"*, *"hours"*, *"minute"*, *"minutes"*, *"second"*, *"seconds"*, *"millisecond"*, *"milliseconds"*, *"microsecond"*, *"microseconds"*, *"nanosecond"*, *"nanoseconds"* », _fallback_).
1. If _largestUnit_ is *"auto"* and _autoValue_ is present, then
1. Return _autoValue_.
1. If the value of _largestUnit_ is in the Plural column of <emu-xref href="#table-temporal-singular-and-plural-units"></emu-xref>, then
1. If _largestUnit_ is in the Plural column of <emu-xref href="#table-temporal-singular-and-plural-units"></emu-xref>, then
1. Set _largestUnit_ to the corresponding Singular value of the same row.
1. If _disallowedUnits_ contains _largestUnit_, then
1. Throw a *RangeError* exception.
Expand All @@ -378,7 +378,7 @@ <h1>ToSmallestTemporalUnit ( _normalizedOptions_, _disallowedUnits_, _fallback_
<emu-alg>
1. Assert: _disallowedUnits_ does not contain _fallback_.
1. Let _smallestUnit_ be ? GetOption(_normalizedOptions_, *"smallestUnit"*, « String », « *"year"*, *"years"*, *"month"*, *"months"*, *"week"*, *"weeks"*, *"day"*, *"days"*, *"hour"*, *"hours"*, *"minute"*, *"minutes"*, *"second"*, *"seconds"*, *"millisecond"*, *"milliseconds"*, *"microsecond"*, *"microseconds"*, *"nanosecond"*, *"nanoseconds"* », _fallback_).
1. If the value of _smallestUnit_ is in the Plural column of <emu-xref href="#table-temporal-singular-and-plural-units"></emu-xref>, then
1. If _smallestUnit_ is in the Plural column of <emu-xref href="#table-temporal-singular-and-plural-units"></emu-xref>, then
1. Set _smallestUnit_ to the corresponding Singular value of the same row.
1. If _disallowedUnits_ contains _smallestUnit_, then
1. Throw a *RangeError* exception.
Expand All @@ -397,7 +397,7 @@ <h1>ToTemporalDurationTotalUnit ( _normalizedOptions_ )</h1>
</p>
<emu-alg>
1. Let _unit_ be ? GetOption(_normalizedOptions_, *"unit"*, « String », « *"year"*, *"years"*, *"month"*, *"months"*, *"week"*, *"weeks"*, *"day"*, *"days"*, *"hour"*, *"hours"*, *"minute"*, *"minutes"*, *"second"*, *"seconds"*, *"millisecond"*, *"milliseconds"*, *"microsecond"*, *"microseconds"*, *"nanosecond"*, *"nanoseconds"* », *undefined*).
1. If the value of _unit_ is in the Plural column of <emu-xref href="#table-temporal-singular-and-plural-units"></emu-xref>, then
1. If _unit_ is in the Plural column of <emu-xref href="#table-temporal-singular-and-plural-units"></emu-xref>, then
1. Set _unit_ to the corresponding Singular value of the same row.
1. Return _unit_.
</emu-alg>
Expand Down Expand Up @@ -1436,10 +1436,10 @@ <h1>PrepareTemporalFields ( _fields_, _fieldNames_, _requiredFields_ )</h1>
1. If _requiredFields_ contains _property_, then
1. Throw a *TypeError* exception.
1. Else,
1. If the value of _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref>, then
1. If _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref>, then
1. Set _value_ to the corresponding Default value of the same row.
1. Else,
1. If the value of _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref>, then
1. If _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref>, then
1. Let _Conversion_ represent the abstract operation named by the Conversion value of the same row.
1. Set _value_ to ? _Conversion_(_value_).
1. Perform ! CreateDataPropertyOrThrow(_result_, _property_, _value_).
Expand Down Expand Up @@ -1592,7 +1592,7 @@ <h1>PreparePartialTemporalFields ( _fields_, _fieldNames_ )</h1>
1. Let _value_ be ? Get(_fields_, _property_).
1. If _value_ is not *undefined*, then
1. Set _any_ to *true*.
1. If the value of _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref>, then
1. If _property_ is in the Property column of <emu-xref href="#table-temporal-field-requirements"></emu-xref>, then
1. Let _Conversion_ represent the abstract operation named by the Conversion value of the same row.
1. Set _value_ to ? _Conversion_(_value_).
1. Perform ! CreateDataPropertyOrThrow(_result_, _property_, _value_).
Expand Down
8 changes: 4 additions & 4 deletions spec/calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h1>CalendarFields ( _calendar_, _fieldNames_ )</h1>
</p>
<emu-alg>
1. Let _fields_ be ? GetMethod(_calendar_, *"fields"*).
1. Let _fieldsArray_ be ? CreateArrayFromList(_fieldNames_).
1. Let _fieldsArray_ be ! CreateArrayFromList(_fieldNames_).
1. If _fields_ is not *undefined*, then
1. Set _fieldsArray_ to ? Call(_fields_, _calendar_, « _fieldsArray_ »).
1. Return ? IterableToListOfType(_fieldsArray_, « String »).
Expand Down Expand Up @@ -532,7 +532,7 @@ <h1>ISOMonthDayFromFields ( _fields_, _options_ )</h1>
1. Set _month_ to ? ResolveISOMonth(_fields_).
1. Let _day_ be ? Get(_fields_, *"day"*).
1. If _day_ is *undefined*, throw a *TypeError* exception.
1. Let _referenceISOYear_ be the first leap year after the Unix epoch (1972).
1. Let _referenceISOYear_ be 1972 (the first leap year after the Unix epoch).
1. If _monthCode_ is *undefined*, then
1. Let _result_ be ? RegulateISODate(_year_, _month_, _day_, _overflow_).
1. Else,
Expand Down Expand Up @@ -807,7 +807,7 @@ <h1>Temporal.Calendar.prototype.dateUntil ( _one_, _two_, _options_ )</h1>
1. Set _two_ to ? ToTemporalDate(_two_).
1. Set _options_ to ? GetOptionsObject(_options_).
1. Let _largestUnit_ be ? ToLargestTemporalUnit(_options_, « *"hour"*, *"minute"*, *"second"*, *"millisecond"*, *"microsecond"*, *"nanosecond"* », *"auto"*, *"day"*).
1. Let _result_ be ? DifferenceISODate(_one_.[[ISOYear]], _one_.[[ISOMonth]], _one_.[[ISODay]], _two_.[[ISOYear]], _two_.[[ISOMonth]], _two_.[[ISODay]], _largestUnit_).
1. Let _result_ be ! DifferenceISODate(_one_.[[ISOYear]], _one_.[[ISOMonth]], _one_.[[ISODay]], _two_.[[ISOYear]], _two_.[[ISOMonth]], _two_.[[ISODay]], _largestUnit_).
1. Return ? CreateTemporalDuration(_result_.[[Years]], _result_.[[Months]], _result_.[[Weeks]], _result_.[[Days]], 0, 0, 0, 0, 0, 0).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -1065,7 +1065,7 @@ <h1>Temporal.Calendar.prototype.fields ( _fields_ )</h1>
1. Perform ? RequireInternalSlot(_calendar_, [[InitializedTemporalCalendar]]).
1. Assert: _calendar_.[[Identifier]] is *"iso8601"*.
1. Let _fieldNames_ be ? IterableToListOfType(_fields_, « String »).
1. Return ? CreateArrayFromList(_fieldNames_).
1. Return ! CreateArrayFromList(_fieldNames_).
</emu-alg>
</emu-clause>

Expand Down
29 changes: 15 additions & 14 deletions spec/duration.html
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ <h1>Temporal.Duration.prototype.round ( _options_ )</h1>
1. Let _balanceResult_ be ? BalanceDurationRelative(_adjustResult_.[[Years]], _adjustResult_.[[Months]], _adjustResult_.[[Weeks]], _adjustResult_.[[Days]], _largestUnit_, _relativeTo_).
1. If _relativeTo_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
1. Set _relativeTo_ to ? MoveRelativeZonedDateTime(_relativeTo_, _balanceResult_.[[Years]], _balanceResult_.[[Months]], _balanceResult_.[[Weeks]], 0).
1. Let _result_ be ? BalanceDuration(_balanceResult_.[[Days]], _adjustResult_.[[Hours]], _adjustResult_.[[Minutes]], _adjustResult_.[[Seconds]], _adjustResult_.[[Milliseconds]], _adjustResult_.[[Microseconds]], _adjustResult.[[Nanoseconds]], _largestUnit_, _relativeTo_).
1. Let _result_ be ? BalanceDuration(_balanceResult_.[[Days]], _adjustResult_.[[Hours]], _adjustResult_.[[Minutes]], _adjustResult_.[[Seconds]], _adjustResult_.[[Milliseconds]], _adjustResult_.[[Microseconds]], _adjustResult_.[[Nanoseconds]], _largestUnit_, _relativeTo_).
1. Return ? CreateTemporalDuration(_balanceResult_.[[Years]], _balanceResult_.[[Months]], _balanceResult_.[[Weeks]], _result_.[[Days]], _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -714,7 +714,7 @@ <h1>ToTemporalDurationRecord ( _temporalDurationLike_ )</h1>
<emu-clause id="sec-temporal-durationsign" aoid="DurationSign">
<h1>DurationSign ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ )</h1>
<emu-alg>
1. For each value _v_ of _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, do
1. For each value _v_ of « _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ », do
1. If _v_ &lt; 0, return −1.
1. If _v_ &gt; 0, return 1.
1. Return 0.
Expand All @@ -728,7 +728,7 @@ <h1>IsValidDuration ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _s
</p>
<emu-alg>
1. Let _sign_ be ! DurationSign(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
1. For each value _v_ of _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, do
1. For each value _v_ of « _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ », do
1. If _v_ is not finite, return *false*.
1. If _v_ &lt; 0 and _sign_ &gt; 0, return *false*.
1. If _v_ &gt; 0 and _sign_ &lt; 0, return *false*.
Expand Down Expand Up @@ -790,7 +790,7 @@ <h1>ToPartialDuration ( _temporalDurationLike_ )</h1>
<h1>CreateTemporalDuration ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ [ , _newTarget_ ] )</h1>
<emu-alg>
1. If ! IsValidDuration(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_) is *false*, throw a *RangeError* exception.
1. If _newTarget_ is not given, set it to %Temporal.Duration%.
1. If _newTarget_ is not present, set it to %Temporal.Duration%.
1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.Duration.prototype%"*, « [[InitializedTemporalDuration]], [[Years]], [[Months]], [[Weeks]], [[Days]], [[Hours]], [[Minutes]], [[Seconds]], [[Milliseconds]], [[Microseconds]], [[Nanoseconds]] »).
1. Set _object_.[[Years]] to _years_.
1. Set _object_.[[Months]] to _months_.
Expand Down Expand Up @@ -828,9 +828,10 @@ <h1>TotalDurationNanoseconds ( _days_, _hours_, _minutes_, _seconds_, _milliseco
The abstract operation TotalDurationNanoseconds computes a mathematical value number of nanoseconds from the given units, applying a given time zone offset shift in nanoseconds when converting from days to hours.
</p>
<emu-alg>
1. Assert: _offsetShift_ is an integer.
1. Set _nanoseconds_ to ℝ(_nanoseconds_).
1. If _days_ ≠ 0, then
1. Set _nanoseconds_ to _nanoseconds_ − ℝ(_offsetShift_).
1. Set _nanoseconds_ to _nanoseconds_ − _offsetShift_.
1. Set _hours_ to ℝ(_hours_) + ℝ(_days_) × 24.
1. Set _minutes_ to ℝ(_minutes_) + _hours_ × 60.
1. Set _seconds_ to ℝ(_seconds_) + _minutes_ × 60.
Expand Down Expand Up @@ -1007,22 +1008,22 @@ <h1>BalanceDurationRelative ( _years_, _months_, _weeks_, _days_, _largestUnit_,
1. Set _relativeTo_ to ? ToTemporalDateTime(_relativeTo_).
1. Let _calendar_ be _relativeTo_.[[Calendar]].
1. If _largestUnit_ is *"year"*, then
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo, _oneYear_).
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Let _oneYearDays_ be _moveResult_.[[Days]].
1. Repeat, while abs(_days_) ≥ abs(_oneYearDays_),
1. Set _days_ to _days_ − _oneYearDays_.
1. Set _years_ to _years_ + _sign_.
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo, _oneYear_).
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Set _oneYearDays_ to _moveResult_.[[Days]].
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo, _oneMonth_).
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Let _oneMonthDays_ be _moveResult_.[[Days]].
1. Repeat, while abs(_days_) ≥ abs(_oneMonthDays_),
1. Set _days_ to _days_ − _oneMonthDays_.
1. Set _months_ to _months_ + _sign_.
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo, _oneMonth_).
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Set _oneMonthDays_ to _moveResult_.[[Days]].
1. Let _dateAdd_ be ? GetMethod(_calendar_, *"dateAdd"*).
Expand All @@ -1044,24 +1045,24 @@ <h1>BalanceDurationRelative ( _years_, _months_, _weeks_, _days_, _largestUnit_,
1. Set _untilResult_ to ? CalendarDateUntil(_calendar_, _relativeTo_, _newRelativeTo_, _untilOptions_, _dateUntil_).
1. Set _oneYearMonths_ to ? Get(_untilResult_, *"months"*).
1. Else if _largestUnit_ is *"month"*, then
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo, _oneMonth_).
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Let _oneMonthDays_ be _moveResult_.[[Days]].
1. Repeat, while abs(_days_) ≥ abs(_oneMonthDays_),
1. Set _days_ to _days_ − _oneMonthDays_.
1. Set _months_ to _months_ + _sign_.
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo, _oneMonth_).
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Set _oneMonthDays_ to _moveResult_.[[Days]].
1. Else,
1. Assert: _largestUnit_ is *"week"*.
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo, _oneWeek_).
1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Let _oneWeekDays_ be _moveResult_.[[Days]].
1. Repeat, while abs(_days_) ≥ abs(_oneWeekDays_),
1. Set _days_ to _days_ − _oneWeekDays_.
1. Set _weeks_ to _weeks_ + _sign_.
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo, _oneWeek_).
1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
1. Set _oneWeekDays_ to _moveResult_.[[Days]].
1. Return the new Record {
Expand Down Expand Up @@ -1177,7 +1178,7 @@ <h1>DaysUntil ( _earlier_, _later_ )</h1>
</p>
<emu-alg>
1. Assert: _earlier_ and _later_ both have [[ISOYear]], [[ISOMonth]], and [[ISODay]] internal slots.
1. Let _difference_ be ? DifferenceISODate(_earlier_.[[ISOYear]], _earlier_.[[ISOMonth]], _earlier_.[[ISODay]], _later_.[[ISOYear]], _later_.[[ISOMonth]], _later_.[[ISODay]], *"day"*).
1. Let _difference_ be ! DifferenceISODate(_earlier_.[[ISOYear]], _earlier_.[[ISOMonth]], _earlier_.[[ISODay]], _later_.[[ISOYear]], _later_.[[ISOMonth]], _later_.[[ISODay]], *"day"*).
1. Return _difference_.[[Days]].
</emu-alg>
</emu-clause>
Expand Down
2 changes: 1 addition & 1 deletion spec/instant.html
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ <h1>CreateTemporalInstant ( _epochNanoseconds_ [ , _newTarget_ ] )</h1>
<emu-alg>
1. Assert: Type(_epochNanoseconds_) is BigInt.
1. Assert: ! IsValidEpochNanoseconds(_epochNanoseconds_) is *true*.
1. If _newTarget_ is not given, set it to %Temporal.Instant%.
1. If _newTarget_ is not present, set it to %Temporal.Instant%.
1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.Instant.prototype%"*, « [[InitializedTemporalInstant]], [[Nanoseconds]] »).
1. Set _object_.[[Nanoseconds]] to _ns_.
1. Return _object_.
Expand Down
Loading