Skip to content

Commit 4a63243

Browse files
committed
Editorial: Move CheckISODaysRange from GetEpochNanosecondsFor to callers
1 parent 58ee13f commit 4a63243

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
@@ -1638,6 +1638,8 @@ <h1>
16381638
1. Let _startEpochNs_ be GetUTCEpochNanoseconds(_startDateTime_).
16391639
1. Let _endEpochNs_ be GetUTCEpochNanoseconds(_endDateTime_).
16401640
1. Else,
1641+
1. Perform ? CheckISODaysRange(_startDateTime_).
1642+
1. Perform ? CheckISODaysRange(_endDateTime_).
16411643
1. Let _startEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _startDateTime_, ~compatible~).
16421644
1. Let _endEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _endDateTime_, ~compatible~).
16431645
1. If _sign_ is 1, then
@@ -1692,8 +1694,10 @@ <h1>
16921694
<emu-alg>
16931695
1. Let _start_ be ? CalendarDateAdd(_calendar_, _isoDateTime_.[[ISODate]], _duration_.[[Date]], ~constrain~).
16941696
1. Let _startDateTime_ be CombineISODateAndTimeRecord(_start_, _isoDateTime_.[[Time]]).
1697+
1. Perform ? CheckISODaysRange(_startDateTime_).
16951698
1. Let _endDate_ be AddDaysToISODate(_start_, _sign_).
16961699
1. Let _endDateTime_ be CombineISODateAndTimeRecord(_endDate_, _isoDateTime_.[[Time]]).
1700+
1. Perform ? CheckISODaysRange(_endDateTime_).
16971701
1. Let _startEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _startDateTime_, ~compatible~).
16981702
1. Let _endEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _endDateTime_, ~compatible~).
16991703
1. Let _daySpan_ be TimeDurationFromEpochNanosecondsDifference(_endEpochNs_, _startEpochNs_).
@@ -1798,6 +1802,7 @@ <h1>
17981802
1. If _timeZone_ is ~unset~, then
17991803
1. Let _endEpochNs_ be GetUTCEpochNanoseconds(_endDateTime_).
18001804
1. Else,
1805+
1. Perform ? CheckISODaysRange(_endDateTime_).
18011806
1. Let _endEpochNs_ be ? GetEpochNanosecondsFor(_timeZone_, _endDateTime_, ~compatible~).
18021807
1. Let _beyondEnd_ be _nudgedEpochNs_ - _endEpochNs_.
18031808
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>
@@ -1127,6 +1128,7 @@ <h1>
11271128
1. Repeat, while _dayCorrection__maxDayCorrection_ and _success_ is *false*,
11281129
1. Let _intermediateDate_ be AddDaysToISODate(_endDateTime_.[[ISODate]], _dayCorrection_ × _sign_).
11291130
1. Let _intermediateDateTime_ be CombineISODateAndTimeRecord(_intermediateDate_, _startDateTime_.[[Time]]).
1131+
1. Perform ? CheckISODaysRange(_intermediateDateTime_).
11301132
1. Let _intermediateNs_ be ? GetEpochNanosecondsFor(_timeZone_, _intermediateDateTime_, ~compatible~).
11311133
1. Set _timeDuration_ to TimeDurationFromEpochNanosecondsDifference(_ns2_, _intermediateNs_).
11321134
1. Let _timeSign_ be TimeDurationSign(_timeDuration_).

0 commit comments

Comments
 (0)