Skip to content

Commit 4b83ba3

Browse files
sffcptomato
authored andcommitted
Editorial: Compute offsetBehaviour after parsing is complete
1 parent d83241f commit 4b83ba3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spec/zoneddatetime.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ <h1>
954954
</dl>
955955
<emu-alg>
956956
1. If _options_ is not present, set _options_ to *undefined*.
957-
1. Let _offsetBehaviour_ be ~option~.
957+
1. Let _hasUTCDesignator_ be *false*.
958958
1. Let _matchBehaviour_ be ~match-exactly~.
959959
1. If _item_ is an Object, then
960960
1. If _item_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
@@ -968,8 +968,6 @@ <h1>
968968
1. Let _fields_ be ? PrepareCalendarFields(_calendar_, _item_, « ~year~, ~month~, ~month-code~, ~day~ », « ~hour~, ~minute~, ~second~, ~millisecond~, ~microsecond~, ~nanosecond~, ~offset~, ~time-zone~ », « ~time-zone~ »).
969969
1. Let _timeZone_ be _fields_.[[TimeZone]].
970970
1. Let _offsetString_ be _fields_.[[OffsetString]].
971-
1. If _offsetString_ is ~unset~, then
972-
1. Set _offsetBehaviour_ to ~wall~.
973971
1. Let _resolvedOptions_ be ? GetOptionsObject(_options_).
974972
1. Let _disambiguation_ be ? GetTemporalDisambiguationOption(_resolvedOptions_).
975973
1. Let _offsetOption_ be ? GetTemporalOffsetOption(_resolvedOptions_, ~reject~).
@@ -985,9 +983,7 @@ <h1>
985983
1. Let _timeZone_ be ? ToTemporalTimeZoneIdentifier(_annotation_).
986984
1. Let _offsetString_ be _result_.[[TimeZone]].[[OffsetString]].
987985
1. If _result_.[[TimeZone]].[[Z]] is *true*, then
988-
1. Set _offsetBehaviour_ to ~exact~.
989-
1. Else if _offsetString_ is ~empty~, then
990-
1. Set _offsetBehaviour_ to ~wall~.
986+
1. Set _hasUTCDesignator_ to *true*.
991987
1. Let _calendar_ be _result_.[[Calendar]].
992988
1. If _calendar_ is ~empty~, set _calendar_ to *"iso8601"*.
993989
1. Set _calendar_ to ? CanonicalizeCalendar(_calendar_).
@@ -1002,6 +998,12 @@ <h1>
1002998
1. Perform ? GetTemporalOverflowOption(_resolvedOptions_).
1003999
1. Let _isoDate_ be CreateISODateRecord(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]]).
10041000
1. Let _time_ be _result_.[[Time]].
1001+
1. If _hasUTCDesignator_ is *true*, then
1002+
1. Let _offsetBehaviour_ be ~exact~.
1003+
1. Else if _offsetString_ is ~empty~ or _offsetString_ is ~unset~, then
1004+
1. Let _offsetBehaviour_ be ~wall~.
1005+
1. Else,
1006+
1. Let _offsetBehaviour_ be ~option~.
10051007
1. Let _offsetNanoseconds_ be 0.
10061008
1. If _offsetBehaviour_ is ~option~, then
10071009
1. Set _offsetNanoseconds_ to ! ParseDateTimeUTCOffset(_offsetString_).

0 commit comments

Comments
 (0)