Skip to content

Commit 90fe431

Browse files
anbaptomato
authored andcommitted
Editorial: Move CheckISODaysRange from GetEpochNanosecondsFor to callers
1 parent 506ff86 commit 90fe431

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

spec/duration.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,8 @@ <h1>
16221622
1. Let _startEpochNs_ be GetUTCEpochNanoseconds(_startDateTime_).
16231623
1. Let _endEpochNs_ be GetUTCEpochNanoseconds(_endDateTime_).
16241624
1. Else,
1625+
1. Perform ? CheckISODaysRange(_startDateTime_).
1626+
1. Perform ? CheckISODaysRange(_endDateTime_).
16251627
1. Let _startEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _startDateTime_, ~compatible~).
16261628
1. Let _endEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _endDateTime_, ~compatible~).
16271629
1. If _sign_ is 1, then
@@ -1676,8 +1678,10 @@ <h1>
16761678
<emu-alg>
16771679
1. Let _start_ be ? CalendarDateAdd(_calendar_, _isoDateTime_.[[ISODate]], _duration_.[[Date]], ~constrain~).
16781680
1. Let _startDateTime_ be CombineISODateAndTimeRecord(_start_, _isoDateTime_.[[Time]]).
1681+
1. Perform ? CheckISODaysRange(_startDateTime_).
16791682
1. Let _endDate_ be AddDaysToISODate(_start_, _sign_).
16801683
1. Let _endDateTime_ be CombineISODateAndTimeRecord(_endDate_, _isoDateTime_.[[Time]]).
1684+
1. Perform ? CheckISODaysRange(_endDateTime_).
16811685
1. Let _startEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _startDateTime_, ~compatible~).
16821686
1. Let _endEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _endDateTime_, ~compatible~).
16831687
1. Let _daySpan_ be TimeDurationFromEpochNanosecondsDifference(_endEpochNs_, _startEpochNs_).
@@ -1782,6 +1786,7 @@ <h1>
17821786
1. If _timeZone_ is ~unset~, then
17831787
1. Let _endEpochNs_ be GetUTCEpochNanoseconds(_endDateTime_).
17841788
1. Else,
1789+
1. Perform ? CheckISODaysRange(_endDateTime_).
17851790
1. Let _endEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _endDateTime_, ~compatible~).
17861791
1. Let _beyondEnd_ be _nudgedEpochNs_ - _endEpochNs_.
17871792
1. If _beyondEnd_ &lt; 0, let _beyondEndSign_ be -1; else if _beyondEnd_ > 0, let _beyondEndSign_ be 1; else let _beyondEndSign_ be 0.

spec/timezone.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ <h1>
276276
</dd>
277277
</dl>
278278
<emu-alg>
279-
1. Perform ? CheckISODaysRange(_isoDateTime_).
279+
1. Assert: ISODateTimeWithinLimits(_isoDateTime_) is *true*.
280280
1. Let _possibleEpochNs_ be ? GetPossibleEpochNanoseconds(_timeZone_, _isoDateTime_).
281281
1. Return ? DisambiguatePossibleEpochNanoseconds(_possibleEpochNs_, _timeZone_, _isoDateTime_, _disambiguation_).
282282
</emu-alg>

spec/zoneddatetime.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ <h1>Temporal.ZonedDateTime.prototype.withPlainTime ( [ _plainTimeLike_ ] )</h1>
550550
1. Else,
551551
1. Let _plainTime_ be ? ToTemporalTime(_plainTimeLike_).
552552
1. Let _resultISODateTime_ be CombineISODateAndTimeRecord(_isoDateTime_.[[ISODate]], _plainTime_.[[Time]]).
553+
1. Perform ? CheckISODaysRange(_resultISODateTime_).
553554
1. Let _epochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _resultISODateTime_, ~compatible~).
554555
1. Return ! CreateTemporalZonedDateTime(_epochNs_, _timeZone_, _calendar_).
555556
</emu-alg>
@@ -1128,6 +1129,7 @@ <h1>
11281129
1. Repeat, while _dayCorrection__maxDayCorrection_ and _success_ is *false*,
11291130
1. Let _intermediateDate_ be AddDaysToISODate(_endDateTime_.[[ISODate]], _dayCorrection_ × _sign_).
11301131
1. Let _intermediateDateTime_ be CombineISODateAndTimeRecord(_intermediateDate_, _startDateTime_.[[Time]]).
1132+
1. Perform ? CheckISODaysRange(_intermediateDateTime_).
11311133
1. Let _intermediateNs_ be ? GetEpochNanosecondsFor(_timeZone_, _intermediateDateTime_, ~compatible~).
11321134
1. Set _timeDuration_ to TimeDurationFromEpochNanosecondsDifference(_ns2_, _intermediateNs_).
11331135
1. Let _timeSign_ be TimeDurationSign(_timeDuration_).

0 commit comments

Comments
 (0)