Skip to content

Commit

Permalink
sync pr/2162
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Apr 29, 2022
1 parent 272a605 commit 406c8cc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion spec/instant.html
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ <h1>
1. Let _maximum_ be ! MaximumTemporalDurationRoundingIncrement(_smallestUnit_).
1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*).
1. Let _roundedNs_ be ! DifferenceInstant(_first_.[[Nanoseconds]], _second_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_).
1. Assert: The following steps cannot fail due to overflow in the Number domain because abs(_roundedNs_) 1.728 × 10<sup>22</sup>.
1. Assert: The following steps cannot fail due to overflow in the Number domain because abs(_roundedNs_) &le; 1.728 &times; 10<sup>22</sup>.
1. Let _result_ be ! BalanceDuration(0, 0, 0, 0, 0, 0, _roundedNs_, _largestUnit_).
1. Return ! CreateTemporalDuration(0, 0, 0, 0, _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
</emu-alg>
Expand Down
6 changes: 3 additions & 3 deletions spec/plaindate.html
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ <h1>CompareISODate ( _y1_, _m1_, _d1_, _y2_, _m2_, _d2_ )</h1>
<emu-clause id="sec-temporal-differencetemporalplaindate" aoid="DifferenceTemporalPlainDate">
<h1>
DifferenceTemporalPlainDate (
_direction_: an integer, 1 or -1,
_direction_: 1 or -1,
_temporalDate_: a Temporal.PlainDate,
_other_: an ECMAScript language value,
_options_: an Object or *undefined*,
Expand All @@ -917,9 +917,9 @@ <h1>
1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, *undefined*, *false*).
1. Let _untilOptions_ be ? MergeLargestUnitOption(_options_, _largestUnit_).
1. Let _result_ be ? CalendarDateUntil(_temporalDate_.[[Calendar]], _temporalDate_, _other_, _untilOptions_).
1. If _smallestUnit_ is not *"day"* or _roundingIncrement_ 1, then
1. If _smallestUnit_ is not *"day"* or _roundingIncrement_ &ne; 1, then
1. Set _result_ to (? RoundDuration(_result_.[[Years]], _result_.[[Months]], _result_.[[Weeks]], _result_.[[Days]], 0, 0, 0, 0, 0, 0, _roundingIncrement_, _smallestUnit_, _roundingMode_, _temporalDate_)).[[DurationRecord]].
1. Return ! CreateTemporalDuration(_direction_ × _result_.[[Years]], _direction_ × _result_.[[Months]], _direction_ × _result_.[[Weeks]], _direction_ × _result_.[[Days]], 0, 0, 0, 0, 0, 0).
1. Return ! CreateTemporalDuration(_direction_ &times; _result_.[[Years]], _direction_ &times; _result_.[[Months]], _direction_ &times; _result_.[[Weeks]], _direction_ &times; _result_.[[Days]], 0, 0, 0, 0, 0, 0).
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down
4 changes: 2 additions & 2 deletions spec/plaindatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ <h1>
<emu-clause id="sec-temporal-differencetemporalplaindatetime" aoid="DifferenceTemporalPlainDateTime">
<h1>
DifferenceTemporalPlainDateTime (
_direction_: an integer, 1 or -1,
_direction_: 1 or -1,
_dateTime_: a Temporal.PlainDateTime,
_other_: an ECMAScript language value,
_options_: an Object or *undefined*,
Expand All @@ -1154,7 +1154,7 @@ <h1>
1. Let _relativeTo_ be ! CreateTemporalDate(_dateTime_.[[ISOYear]], _dateTime_.[[ISOMonth]], _dateTime_.[[ISODay]], _dateTime_.[[Calendar]]).
1. Let _roundResult_ be (? RoundDuration(_diff_.[[Years]], _diff_.[[Months]], _diff_.[[Weeks]], _diff_.[[Days]], _diff_.[[Hours]], _diff_.[[Minutes]], _diff_.[[Seconds]], _diff_.[[Milliseconds]], _diff_.[[Microseconds]], _diff_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_, _relativeTo_)).[[DurationRecord]].
1. Let _result_ be ? BalanceDuration(_roundResult_.[[Days]], _roundResult_.[[Hours]], _roundResult_.[[Minutes]], _roundResult_.[[Seconds]], _roundResult_.[[Milliseconds]], _roundResult_.[[Microseconds]], _roundResult_.[[Nanoseconds]], _largestUnit_).
1. Return ! CreateTemporalDuration(_direction_ × _roundResult_.[[Years]], _direction_ × _roundResult_.[[Months]], _direction_ × _roundResult_.[[Weeks]], _direction_ × _result_.[[Days]], _direction_ × _result_.[[Hours]], _direction_ × _result_.[[Minutes]], _direction_ × _result_.[[Seconds]], _direction_ × _result_.[[Milliseconds]], _direction_ × _result_.[[Microseconds]], _direction_ × _result_.[[Nanoseconds]]).
1. Return ! CreateTemporalDuration(_direction_ &times; _roundResult_.[[Years]], _direction_ &times; _roundResult_.[[Months]], _direction_ &times; _roundResult_.[[Weeks]], _direction_ &times; _result_.[[Days]], _direction_ &times; _result_.[[Hours]], _direction_ &times; _result_.[[Minutes]], _direction_ &times; _result_.[[Seconds]], _direction_ &times; _result_.[[Milliseconds]], _direction_ &times; _result_.[[Microseconds]], _direction_ &times; _result_.[[Nanoseconds]]).
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down
6 changes: 3 additions & 3 deletions spec/plaintime.html
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ <h1>RoundTime ( _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanos
<emu-clause id="sec-temporal-differencetemporalplaintime" aoid="DifferenceTemporalPlainTime">
<h1>
DifferenceTemporalPlainTime (
_direction_: an integer, 1 or -1,
_direction_: 1 or -1,
_temporalTime_: a Temporal.PlainTime,
_other_: an ECMAScript language value,
_options_: an Object or *undefined*,
Expand All @@ -961,8 +961,8 @@ <h1>
1. Let _maximum_ be ! MaximumTemporalDurationRoundingIncrement(_smallestUnit_).
1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*).
1. Let _result_ be ! DifferenceTime(_other_.[[ISOHour]], _other_.[[ISOMinute]], _other_.[[ISOSecond]], _other_.[[ISOMillisecond]], _other_.[[ISOMicrosecond]], _other_.[[ISONanosecond]], _temporalTime_.[[ISOHour]], _temporalTime_.[[ISOMinute]], _temporalTime_.[[ISOSecond]], _temporalTime_.[[ISOMillisecond]], _temporalTime_.[[ISOMicrosecond]], _temporalTime_.[[ISONanosecond]]).
1. Set _result_ to (? RoundDuration(0, 0, 0, 0, _direction_ × _result_.[[Hours]], _direction_ × _result_.[[Minutes]], _direction_ × _result_.[[Seconds]], _direction_ × _result_.[[Milliseconds]], _direction_ × _result_.[[Microseconds]], _direction_ × _result_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_)).[[DurationRecord]].
1. Set _result_ to ? BalanceDuration(0, _direction_ × _result_.[[Hours]], _direction_ × _result_.[[Minutes]], _direction_ × _result_.[[Seconds]], _direction_ × _result_.[[Milliseconds]], _direction_ × _result_.[[Microseconds]], _direction_ × _result_.[[Nanoseconds]], _largestUnit_).
1. Set _result_ to (? RoundDuration(0, 0, 0, 0, _direction_ &times; _result_.[[Hours]], _direction_ &times; _result_.[[Minutes]], _direction_ &times; _result_.[[Seconds]], _direction_ &times; _result_.[[Milliseconds]], _direction_ &times; _result_.[[Microseconds]], _direction_ &times; _result_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_)).[[DurationRecord]].
1. Set _result_ to ? BalanceDuration(0, _direction_ &times; _result_.[[Hours]], _direction_ &times; _result_.[[Minutes]], _direction_ &times; _result_.[[Seconds]], _direction_ &times; _result_.[[Milliseconds]], _direction_ &times; _result_.[[Microseconds]], _direction_ &times; _result_.[[Nanoseconds]], _largestUnit_).
1. Return ! CreateTemporalDuration(0, 0, 0, 0, _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
</emu-alg>
</emu-clause>
Expand Down
6 changes: 3 additions & 3 deletions spec/plainyearmonth.html
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ <h1>TemporalYearMonthToString ( _yearMonth_, _showCalendar_ )</h1>
<emu-clause id="sec-temporal-differencetemporalplainyearmonth" aoid="DifferenceTemporalPlainYearMonth">
<h1>
DifferenceTemporalPlainYearMonth (
_direction_: an integer, 1 or -1,
_direction_: 1 or -1,
_yearMonth_: a Temporal.PlainYearMonth,
_other_: an ECMAScript language value,
_options_: an Object or *undefined*,
Expand Down Expand Up @@ -683,9 +683,9 @@ <h1>
1. Let _thisDate_ be ? CalendarDateFromFields(_calendar_, _thisFields_).
1. Let _untilOptions_ be ? MergeLargestUnitOption(_options_, _largestUnit_).
1. Let _result_ be ? CalendarDateUntil(_calendar_, _thisDate_, _otherDate_, _untilOptions_).
1. If _smallestUnit_ is not *"month"* or _roundingIncrement_ 1, then
1. If _smallestUnit_ is not *"month"* or _roundingIncrement_ &ne; 1, then
1. Let _result_ be (? RoundDuration(_result_.[[Years]], _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0, _roundingIncrement_, _smallestUnit_, _roundingMode_, _thisDate_)).[[DurationRecord]].
1. Return ! CreateTemporalDuration(_direction_ × _result_.[[Years]], _direction_ × _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0).
1. Return ! CreateTemporalDuration(_direction_ &times; _result_.[[Years]], _direction_ &times; _result_.[[Months]], 0, 0, 0, 0, 0, 0, 0, 0).
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down
8 changes: 4 additions & 4 deletions spec/zoneddatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ <h1>
<emu-clause id="sec-temporal-differencetemporalzoneddatetime" aoid="DifferenceTemporalZonedDateTime">
<h1>
DifferenceTemporalZonedDateTime (
_direction_: an integer, 1 or -1,
_direction_: 1 or -1,
_zonedDateTime_: a Temporal.ZonedDateTime,
_other_: an ECMAScript language value,
_options_: an Object or *undefined*,
Expand All @@ -1379,16 +1379,16 @@ <h1>
1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*).
1. If _largestUnit_ is not one of *"year"*, *"month"*, *"week"*, or *"day"*, then
1. Let _differenceNs_ be ! DifferenceInstant(_zonedDateTime_.[[Nanoseconds]], _other_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_).
1. Assert: The following steps cannot fail due to overflow in the Number domain because abs(_differenceNs_) 1.728 × 10<sup>22</sup>.
1. Assert: The following steps cannot fail due to overflow in the Number domain because abs(_differenceNs_) &le; 1.728 &times; 10<sup>22</sup>.
1. Let _balanceResult_ be ! BalanceDuration(0, 0, 0, 0, 0, 0, _differenceNs_, _largestUnit_).
1. Return ! CreateTemporalDuration(0, 0, 0, 0, _direction_ × _balanceResult_.[[Hours]], _direction_ × _balanceResult_.[[Minutes]], _direction_ × _balanceResult_.[[Seconds]], _direction_ × _balanceResult_.[[Milliseconds]], _direction_ × _balanceResult_.[[Microseconds]], _direction_ × _balanceResult_.[[Nanoseconds]]).
1. Return ! CreateTemporalDuration(0, 0, 0, 0, _direction_ &times; _balanceResult_.[[Hours]], _direction_ &times; _balanceResult_.[[Minutes]], _direction_ &times; _balanceResult_.[[Seconds]], _direction_ &times; _balanceResult_.[[Milliseconds]], _direction_ &times; _balanceResult_.[[Microseconds]], _direction_ &times; _balanceResult_.[[Nanoseconds]]).
1. If ? TimeZoneEquals(_zonedDateTime_.[[TimeZone]], _other_.[[TimeZone]]) is *false*, then
1. Throw a *RangeError* exception.
1. Let _untilOptions_ be ? MergeLargestUnitOption(_options_, _largestUnit_).
1. Let _difference_ be ? DifferenceZonedDateTime(_zonedDateTime_.[[Nanoseconds]], _other_.[[Nanoseconds]], _zonedDateTime_.[[TimeZone]], _zonedDateTime_.[[Calendar]], _largestUnit_, _untilOptions_).
1. Let _roundResult_ be (? RoundDuration(_difference_.[[Years]], _difference_.[[Months]], _difference_.[[Weeks]], _difference_.[[Days]], _difference_.[[Hours]], _difference_.[[Minutes]], _difference_.[[Seconds]], _difference_.[[Milliseconds]], _difference_.[[Microseconds]], _difference_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_, _zonedDateTime_)).[[DurationRecord]].
1. Let _result_ be ? AdjustRoundedDurationDays(_roundResult_.[[Years]], _roundResult_.[[Months]], _roundResult_.[[Weeks]], _roundResult_.[[Days]], _roundResult_.[[Hours]], _roundResult_.[[Minutes]], _roundResult_.[[Seconds]], _roundResult_.[[Milliseconds]], _roundResult_.[[Microseconds]], _roundResult_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_, _zonedDateTime_).
1. Return ! CreateTemporalDuration(_direction_ × _result_.[[Years]], _direction_ × _result_.[[Months]], _direction_ × _result_.[[Weeks]], _direction_ × _result_.[[Days]], _direction_ × _result_.[[Hours]], _direction_ × _result_.[[Minutes]], _direction_ × _result_.[[Seconds]], _direction_ × _result_.[[Milliseconds]], _direction_ × _result_.[[Microseconds]], _direction_ × _result_.[[Nanoseconds]]).
1. Return ! CreateTemporalDuration(_direction_ &times; _result_.[[Years]], _direction_ &times; _result_.[[Months]], _direction_ &times; _result_.[[Weeks]], _direction_ &times; _result_.[[Days]], _direction_ &times; _result_.[[Hours]], _direction_ &times; _result_.[[Minutes]], _direction_ &times; _result_.[[Seconds]], _direction_ &times; _result_.[[Milliseconds]], _direction_ &times; _result_.[[Microseconds]], _direction_ &times; _result_.[[Nanoseconds]]).
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down

0 comments on commit 406c8cc

Please sign in to comment.