Skip to content

Commit 07b9476

Browse files
committed
Editorial: Add assertion that epoch nanoseconds are valid
1 parent c8934a7 commit 07b9476

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
@@ -1085,6 +1085,7 @@ <h1>
10851085
</dd>
10861086
</dl>
10871087
<emu-alg>
1088+
1. Assert: IsValidEpochNanoseconds(_epochNanoseconds_) is *true*.
10881089
1. If DateDurationSign(_duration_.[[Date]]) = 0, then
10891090
1. Return ? AddInstant(_epochNanoseconds_, _duration_.[[Time]]).
10901091
1. Let _isoDateTime_ be GetISODateTimeFor(_timeZone_, _epochNanoseconds_).
@@ -1113,6 +1114,8 @@ <h1>
11131114
</dd>
11141115
</dl>
11151116
<emu-alg>
1117+
1. Assert: IsValidEpochNanoseconds(_ns1_) is *true*.
1118+
1. Assert: IsValidEpochNanoseconds(_ns2_) is *true*.
11161119
1. If _ns1_ = _ns2_, return ! CombineDateAndTimeDuration(ZeroDateDuration(), 0).
11171120
1. Let _startDateTime_ be GetISODateTimeFor(_timeZone_, _ns1_).
11181121
1. Let _endDateTime_ be GetISODateTimeFor(_timeZone_, _ns2_).
@@ -1156,6 +1159,8 @@ <h1>
11561159
<dd></dd>
11571160
</dl>
11581161
<emu-alg>
1162+
1. Assert: IsValidEpochNanoseconds(_ns1_) is *true*.
1163+
1. Assert: IsValidEpochNanoseconds(_ns2_) is *true*.
11591164
1. If TemporalUnitCategory(_largestUnit_) is ~time~, then
11601165
1. Return DifferenceInstant(_ns1_, _ns2_, _roundingIncrement_, _smallestUnit_, _roundingMode_).
11611166
1. Let _difference_ be ? DifferenceZonedDateTime(_ns1_, _ns2_, _timeZone_, _calendar_, _largestUnit_).
@@ -1180,6 +1185,8 @@ <h1>
11801185
<dd></dd>
11811186
</dl>
11821187
<emu-alg>
1188+
1. Assert: IsValidEpochNanoseconds(_ns1_) is *true*.
1189+
1. Assert: IsValidEpochNanoseconds(_ns2_) is *true*.
11831190
1. If TemporalUnitCategory(_unit_) is ~time~, then
11841191
1. Let _difference_ be TimeDurationFromEpochNanosecondsDifference(_ns2_, _ns1_).
11851192
1. Return TotalTimeDuration(_difference_, _unit_).

0 commit comments

Comments
 (0)