-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editorial: Simplify date/time range validation
This commit refactors several operations related to range validation of Temporal.PlainDateTime and Temporal.Instant. * Adds optional _offsetNanoseconds_ parameter to GetUTCEpochNanoseconds, and uses it in call sites of GetUTCEpochNanoseconds where an offset was previously applied to its result. * Makes polyfill GetUTCEpochNanoseconds infallible, like in the spec. * Simplifies the polyfill's GetNamedTimeZoneOffsetNanoseconds by using the now-infallible GetUTCEpochNanoseconds. * Simplifies the polyfill's PlainDateTime range validation in RejectDateTimeRange. * Clarifies the PlainDateTime docs about that type's valid range. * Removes non-parsing logic from ParseTemporalInstantString, aligning Instant parsing with the parsing pattern used in other Temporal types where parsing AOs contain only parsing without interpretation. * Inlines the single-caller ParseTemporalInstant into ToTemporalInstant, matching the pattern used by ToTemporalYearMonth, ToTemporalTime, etc. * Marks ParseDateTimeUTCOffset as infallible after parsing instant strings, because ParseTemporalInstantString guarantees that the offset is valid. Fixes #2637. * Aligns polyfill more closely to spec for Instant parsing.
- Loading branch information
1 parent
1cf10f3
commit a1f2a9f
Showing
8 changed files
with
164 additions
and
123 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
Oops, something went wrong.