-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw RangeError if bad offset in property bags
Ensure that, per spec, a RangeError is thrown when an invalid offset is passed to ParseTimeZoneOffsetString. Note that validation of the offset in ISO strings is handled separately; this PR only fixes cases where an offset is parsed on its own, e.g. when property bag inputs are used in `ZonedDateTime#[with|from|equals|until|since|compare]` or as options in `Duration#[add|subtract|compare|round|total]`. The problem was also present in `TimeZone.from` and `ZonedDateTime#withTimeZone` but was caught downstream so didn't fail any previous tests. This commit also renames `ParseOffsetString` to `ParseTimeZoneOffsetString` which is the AO name in the spec. This commit also adds a new `ES.TestTimeZoneOffsetString` function which checks to see if the string matches the offset regex. This is used in cases where throwing on invalid offset strings is not desired.
- Loading branch information
1 parent
90ee179
commit c83a394
Showing
5 changed files
with
142 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters