Skip to content

Commit f1f016e

Browse files
anbaptomato
authored andcommitted
Normative: Check for invalid epoch nanoseconds in NanosecondsToDays
Fixes #2237
1 parent cdfe4a5 commit f1f016e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spec/zoneddatetime.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,7 @@ <h1>
13071307
1. Let _startInstant_ be ! CreateTemporalInstant(ℤ(_startNs_)).
13081308
1. Let _startDateTime_ be ? BuiltinTimeZoneGetPlainDateTimeFor(_relativeTo_.[[TimeZone]], _startInstant_, _relativeTo_.[[Calendar]]).
13091309
1. Let _endNs_ be _startNs_ + _nanoseconds_.
1310+
1. If ! IsValidEpochNanoseconds(ℤ(_endNs_)) is *false*, throw a *RangeError* exception.
13101311
1. Let _endInstant_ be ! CreateTemporalInstant(ℤ(_endNs_)).
13111312
1. Let _endDateTime_ be ? BuiltinTimeZoneGetPlainDateTimeFor(_relativeTo_.[[TimeZone]], _endInstant_, _relativeTo_.[[Calendar]]).
13121313
1. Let _dateDifference_ be ? DifferenceISODateTime(_startDateTime_.[[ISOYear]], _startDateTime_.[[ISOMonth]], _startDateTime_.[[ISODay]], _startDateTime_.[[ISOHour]], _startDateTime_.[[ISOMinute]], _startDateTime_.[[ISOSecond]], _startDateTime_.[[ISOMillisecond]], _startDateTime_.[[ISOMicrosecond]], _startDateTime_.[[ISONanosecond]], _endDateTime_.[[ISOYear]], _endDateTime_.[[ISOMonth]], _endDateTime_.[[ISODay]], _endDateTime_.[[ISOHour]], _endDateTime_.[[ISOMinute]], _endDateTime_.[[ISOSecond]], _endDateTime_.[[ISOMillisecond]], _endDateTime_.[[ISOMicrosecond]], _endDateTime_.[[ISONanosecond]], _relativeTo_.[[Calendar]], *"day"*, OrdinaryObjectCreate(*null*)).

0 commit comments

Comments
 (0)