Skip to content

Commit

Permalink
Editorial: Fix errors introduced in #2166 (#2179)
Browse files Browse the repository at this point in the history
* Editorial: Rename AddTemporalPlainYearMonth to AddDurationToOrSubtractDurationFromPlainYearMonth

This AO has both addition and subtraction behavior, based on the first
argument. Update the name accordingly and bring it in line with these
similar AOs:

- AddDurationToOrSubtractDurationFromDuration
- AddDurationToOrSubtractDurationFromInstant
- AddDurationToOrSubtractDurationFromPlainDateTime
- AddDurationToOrSubtractDurationFromPlainTime
- AddDurationToOrSubtractDurationFromZonedDateTime

* Editorial: Fix rendering of 'subtract' in structured header

* Editorial: Pass correct values to AddDurationToOrSubtractDurationFromPlainTime

This fixes a 'normative typo' introduced in #2166.
Instead of passing temporalTime twice, we need to also pass
temporalDurationLike.
  • Loading branch information
linusg authored May 6, 2022
1 parent 3eab7e4 commit fbff635
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions spec/plaintime.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ <h1>Temporal.PlainTime.prototype.add ( _temporalDurationLike_ )</h1>
<emu-alg>
1. Let _temporalTime_ be the *this* value.
1. Perform ? RequireInternalSlot(_temporalTime_, [[InitializedTemporalTime]]).
1. Return ? AddDurationToOrSubtractDurationFromPlainTime(~add~, _temporalTime_, _temporalTime_).
1. Return ? AddDurationToOrSubtractDurationFromPlainTime(~add~, _temporalTime_, _temporalDurationLike_).
</emu-alg>
</emu-clause>

Expand All @@ -223,7 +223,7 @@ <h1>Temporal.PlainTime.prototype.subtract ( _temporalDurationLike_ )</h1>
<emu-alg>
1. Let _temporalTime_ be the *this* value.
1. Perform ? RequireInternalSlot(_temporalTime_, [[InitializedTemporalTime]]).
1. Return ? AddDurationToOrSubtractDurationFromPlainTime(~subtract~, _temporalTime_, _temporalTime_).
1. Return ? AddDurationToOrSubtractDurationFromPlainTime(~subtract~, _temporalTime_, _temporalDurationLike_).
</emu-alg>
</emu-clause>

Expand Down
10 changes: 5 additions & 5 deletions spec/plainyearmonth.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h1>Temporal.PlainYearMonth.prototype.add ( _temporalDurationLike_ [ , _options_
<emu-alg>
1. Let _yearMonth_ be the *this* value.
1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
1. Return ? AddTemporalPlainYearMonth(~add~, _yearMonth_, _temporalDurationLike_, _options_).
1. Return ? AddDurationToOrSubtractDurationFromPlainYearMonth(~add~, _yearMonth_, _temporalDurationLike_, _options_).
</emu-alg>
</emu-clause>

Expand All @@ -264,7 +264,7 @@ <h1>Temporal.PlainYearMonth.prototype.subtract ( _temporalDurationLike_ [ , _opt
<emu-alg>
1. Let _yearMonth_ be the *this* value.
1. Perform ? RequireInternalSlot(_yearMonth_, [[InitializedTemporalYearMonth]]).
1. Return ? AddTemporalPlainYearMonth(~subtract~, _yearMonth_, _temporalDurationLike_, _options_).
1. Return ? AddDurationToOrSubtractDurationFromPlainYearMonth(~subtract~, _yearMonth_, _temporalDurationLike_, _options_).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -654,10 +654,10 @@ <h1>TemporalYearMonthToString ( _yearMonth_, _showCalendar_ )</h1>
1. Return _result_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-temporal-addtemporalplainyearmonth" type="abstract operation">
<emu-clause id="sec-temporal-adddurationtoorsubtractdurationfromplainyearmonth" type="abstract operation">
<h1>
AddTemporalPlainYearMonth (
_operation_: ~add~ or ~subtract_,
AddDurationToOrSubtractDurationFromPlainYearMonth (
_operation_: ~add~ or ~subtract~,
_yearMonth_: a Temporal.PlainYearMonth,
_temporalDurationLike_: an ECMAScript language value,
_options_: an ECMAScript language value,
Expand Down

0 comments on commit fbff635

Please sign in to comment.