Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ <h1>ParseTemporalTimeZoneString ( _isoString_ )</h1>
1. Assert: Type(_isoString_) is String.
1. If _isoString_ does not satisfy the syntax of a |TemporalTimeZoneString| (see <emu-xref href="#sec-temporal-iso8601grammar"></emu-xref>), then
1. Throw a *RangeError* exception.
1. Let _z_, _sign_, _hours_, _minutes_, _seconds_, _fraction_ and _name_ be the parts of _isoString_ produced respectively by the |UTCDesignator|, |TimeZoneUTCOffsetSign|, |TimeZoneUTCOffsetHour|, |TimeZoneUTCOffsetMinute|, |TimeZoneUTCOffsetSecond|, |TimeZoneUTCOffsetFractionalPart|, and |TimeZoneIANAName| productions, or *undefined* if not present.
1. Let _z_, _sign_, _hours_, _minutes_, _seconds_, _fraction_ and _name_ be the parts of _isoString_ produced respectively by the |UTCDesignator|, |TimeZoneUTCOffsetSign|, |TimeZoneUTCOffsetHour|, |TimeZoneUTCOffsetMinute|, |TimeZoneUTCOffsetSecond|, |TimeZoneUTCOffsetFractionalPart|, and |TimeZoneBracketedName| productions, or *undefined* if not present.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not look correct to me; I don't think ParseTemporalTimeZoneString input like "2021-12-28T17:42:00Z[-05:00]" (which includes TimeZoneBracketedName but not TimeZoneIANAName) should result in a record with nonempty [[Name]] or input like "2021-12-28T17:42:00+00:00[-05:00]" (likewise) should be rejected when "-05:00" does not pass the IsValidTimeZoneName check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gibson042 could you take a look at tc39/test262#3319 and give your opinion there? I have no strong opinion about this PR . I propose it because @ptomato said it is a spec bug not a bug in the tests. But I am pretty sure this PR in the current shape fix the problem.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, a [[Name]] containing an offset string cannot be passed to IsValidTimeZoneName, so if we make this change, we will have to check for that possibility down below. But I think it is correct that 2021-12-28T17:42:00Z[-05:00] should result in { [[Z]]: true, [[OffsetString]]: undefined, [[Name]]: "-05:00" }. That seems to be what ParseTemporalZonedDateTimeString expects.

Re. the former fix, it may be easier if you implement this on top of #1953.

1. If _z_ is not *undefined*, then
1. Return the Record {
[[Z]]: *true*,
Expand Down