forked from tc39/proposal-temporal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve "missing time in string" error message
Slightly refector the implementation of tc39#1952 to enable a clearer error message when the user tries to parse a date-only string with `PlainTime.from`. This is the same pattern that's used for other polyfill parsing: `ParseISODateTime` is used for generic, regex-only parsing while type-specific validation happens in the calling method, e.g. `ParseTemporalTimeString` or `ParseTemporalZonedDateTimeString`. Also add tests to verify that date strings are not allowed, and that space is not accepted as a time designator prefix even though space is accepted as a date/time separator.
- Loading branch information
1 parent
514ede3
commit 61de8e8
Showing
2 changed files
with
14 additions
and
6 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