Skip to content

Commit d53af7f

Browse files
linusgptomato
authored andcommitted
Normative: Fix fraction substring in ParseTimeZoneOffsetString
The fraction variable captures the result of the TimeZoneUTCOffsetFraction production, which is the two productions DecimalSeparator and TimeZoneUTCOffsetFractionalPart, meaning that the result will contain a decimal separator. When it later appends zeros and gets a substring of the first nine characters, that separator character is still included and will cause ToIntegerOrInfinity to return an incorrect result (always 0). Fix this by changing the substring range to '1 to 10' so the result doesn't contain the decimal separator and the AO works as expected. This mistake was already present in the initial revision of the ParseTimeZoneOffsetString AO when it was added in 01f3c55.
1 parent 97d553c commit d53af7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/timezone.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h1>ParseTimeZoneOffsetString ( _offsetString_ )</h1>
514514
1. Set _seconds_ to ! ToIntegerOrInfinity(_seconds_).
515515
1. If _fraction_ is not *undefined*, then
516516
1. Set _fraction_ to the string-concatenation of the previous value of _fraction_ and the string *"000000000"*.
517-
1. Let _nanoseconds_ be the String value equal to the substring of _fraction_ from 0 to 9.
517+
1. Let _nanoseconds_ be the String value equal to the substring of _fraction_ from 1 to 10.
518518
1. Set _nanoseconds_ to ! ToIntegerOrInfinity(_nanoseconds_).
519519
1. Else,
520520
1. Let _nanoseconds_ be 0.

0 commit comments

Comments
 (0)