Skip to content

Commit

Permalink
Normative: Don't validate numeric timezone in ToRelativeTemporalObject
Browse files Browse the repository at this point in the history
It was checking if parsing TimeZoneNumericUTCOffset from the provided
timeZoneName is *not* a list of errors, i.e. it matches the production.
If that's the case, it would try to validate and normalize the time zone
offset, which would both fail - these steps should apply to an IANA time
zone name instead, i.e. when parsing *does* produce a list of errors and
the string doesn't match TimeZoneNumericUTCOffset.

This mistake was introduced in 2a81fbc, the updated code now matches the
validation & normalization steps in ToTemporalZonedDateTime.
  • Loading branch information
linusg authored and ptomato committed Mar 29, 2022
1 parent 4776571 commit 4cb192d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ <h1>ToRelativeTemporalObject ( _options_ )</h1>
1. Let _offsetString_ be _result_.[[TimeZoneOffsetString]].
1. Let _timeZoneName_ be _result_.[[TimeZoneIANAName]].
1. If _timeZoneName_ is not *undefined*, then
1. If ParseText(StringToCodePoints(_timeZoneName_), |TimeZoneNumericUTCOffset|) is not a List of errors, then
1. If ParseText(StringToCodePoints(_timeZoneName_), |TimeZoneNumericUTCOffset|) is a List of errors, then
1. If ! IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception.
1. Set _timeZoneName_ to ! CanonicalizeTimeZoneName(_timeZoneName_).
1. Let _timeZone_ be ! CreateTemporalTimeZone(_timeZoneName_).
Expand Down

0 comments on commit 4cb192d

Please sign in to comment.