Skip to content

Commit c0f30a4

Browse files
committed
Editorial: Add assertion that epoch nanoseconds are valid
1 parent 9ce05ab commit c0f30a4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

spec/timezone.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ <h1>
255255
</dd>
256256
</dl>
257257
<emu-alg>
258+
1. Assert: IsValidEpochNanoseconds(_epochNs_) is *true*.
258259
1. Let _offsetNanoseconds_ be GetOffsetNanosecondsFor(_timeZone_, _epochNs_).
259260
1. Let _result_ be GetISOPartsFromEpoch(ℝ(_epochNs_)).
260261
1. Return AddOffsetNanosecondsToISODateTime(_result_, _offsetNanoseconds_).

spec/zoneddatetime.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ <h1>
10841084
</dd>
10851085
</dl>
10861086
<emu-alg>
1087+
1. Assert: IsValidEpochNanoseconds(_epochNanoseconds_) is *true*.
10871088
1. If DateDurationSign(_duration_.[[Date]]) = 0, then
10881089
1. Return ? AddInstant(_epochNanoseconds_, _duration_.[[Time]]).
10891090
1. Let _isoDateTime_ be GetISODateTimeFor(_timeZone_, _epochNanoseconds_).
@@ -1112,6 +1113,8 @@ <h1>
11121113
</dd>
11131114
</dl>
11141115
<emu-alg>
1116+
1. Assert: IsValidEpochNanoseconds(_ns1_) is *true*.
1117+
1. Assert: IsValidEpochNanoseconds(_ns2_) is *true*.
11151118
1. If _ns1_ = _ns2_, return ! CombineDateAndTimeDuration(ZeroDateDuration(), 0).
11161119
1. Let _startDateTime_ be GetISODateTimeFor(_timeZone_, _ns1_).
11171120
1. Let _endDateTime_ be GetISODateTimeFor(_timeZone_, _ns2_).
@@ -1155,6 +1158,8 @@ <h1>
11551158
<dd></dd>
11561159
</dl>
11571160
<emu-alg>
1161+
1. Assert: IsValidEpochNanoseconds(_ns1_) is *true*.
1162+
1. Assert: IsValidEpochNanoseconds(_ns2_) is *true*.
11581163
1. If TemporalUnitCategory(_largestUnit_) is ~time~, then
11591164
1. Return DifferenceInstant(_ns1_, _ns2_, _roundingIncrement_, _smallestUnit_, _roundingMode_).
11601165
1. Let _difference_ be ? DifferenceZonedDateTime(_ns1_, _ns2_, _timeZone_, _calendar_, _largestUnit_).
@@ -1179,6 +1184,8 @@ <h1>
11791184
<dd></dd>
11801185
</dl>
11811186
<emu-alg>
1187+
1. Assert: IsValidEpochNanoseconds(_ns1_) is *true*.
1188+
1. Assert: IsValidEpochNanoseconds(_ns2_) is *true*.
11821189
1. If TemporalUnitCategory(_unit_) is ~time~, then
11831190
1. Let _difference_ be TimeDurationFromEpochNanosecondsDifference(_ns2_, _ns1_).
11841191
1. Return TotalTimeDuration(_difference_, _unit_).

0 commit comments

Comments
 (0)