Skip to content

Commit

Permalink
Normative: Disallow out-of-range return from previous / next transition
Browse files Browse the repository at this point in the history
In GetIANATimeZonePreviousTransition and GetIANATimeZoneNextTransition,
disallow returning a number of epoch nanoseconds that is outside of the
allowed range for Temporal.Instant, and return null instead.

Not throwing here is consistent with also not throwing in
SystemUTCEpochNanoseconds.
  • Loading branch information
ptomato committed Jul 25, 2022
1 parent 374305c commit f3c771f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ <h1>
<dl class="header">
</dl>
<p>
The returned value represents the number of nanoseconds since the Unix epoch in UTC that corresponds to the first time zone transition after _epochNanoseconds_ in the IANA time zone identified by _timeZoneIdentifier_, or *null* if no such transition exists.
The returned value _t_ represents the number of nanoseconds since the Unix epoch in UTC that corresponds to the first time zone transition after _epochNanoseconds_ in the IANA time zone identified by _timeZoneIdentifier_.
The operation returns *null* if no such transition exists for which _t_ &le; ℤ(nsMaxInstant).
</p>
<p>
Given the same values of _epochNanoseconds_ and _timeZoneIdentifier_, the result must be the same for the lifetime of the surrounding agent.
Expand All @@ -523,7 +524,8 @@ <h1>
<dl class="header">
</dl>
<p>
The returned value represents the number of nanoseconds since the Unix epoch in UTC that corresponds to the last time zone transition before _epochNanoseconds_ in the IANA time zone identified by _timeZoneIdentifier_, or *null* if no such transition exists.
The returned value _t_ represents the number of nanoseconds since the Unix epoch in UTC that corresponds to the last time zone transition before _epochNanoseconds_ in the IANA time zone identified by _timeZoneIdentifier_.
The operation returns *null* if no such transition exists for which _t_ &ge; ℤ(nsMinInstant).
</p>
<p>
Given the same values of _epochNanoseconds_ and _timeZoneIdentifier_, the result must be the same for the lifetime of the surrounding agent.
Expand Down

0 comments on commit f3c771f

Please sign in to comment.