mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:17:44 +00:00
LibJS: Reject ambiguous time string even with a calendar
This is a normative change in the Temporal spec.
See: 5e2afb9
This commit is contained in:
parent
2cf5f5c278
commit
b438839fcc
1 changed files with 7 additions and 13 deletions
|
@ -999,8 +999,7 @@ bool ISO8601Parser::parse_calendar_time()
|
|||
{
|
||||
// CalendarTime :
|
||||
// TimeDesignator TimeSpec TimeZone[opt] Calendar[opt]
|
||||
// TimeSpec TimeZone[opt] Calendar
|
||||
// TimeSpecWithOptionalTimeZoneNotAmbiguous
|
||||
// TimeSpecWithOptionalTimeZoneNotAmbiguous Calendar[opt]
|
||||
{
|
||||
StateTransaction transaction { *this };
|
||||
if (parse_time_designator() && parse_time_spec()) {
|
||||
|
@ -1010,17 +1009,12 @@ bool ISO8601Parser::parse_calendar_time()
|
|||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
StateTransaction transaction { *this };
|
||||
if (parse_time_spec()) {
|
||||
(void)parse_time_zone();
|
||||
if (parse_calendar()) {
|
||||
transaction.commit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return parse_time_spec_with_optional_time_zone_not_ambiguous();
|
||||
StateTransaction transaction { *this };
|
||||
if (!parse_time_spec_with_optional_time_zone_not_ambiguous())
|
||||
return false;
|
||||
(void)parse_calendar();
|
||||
transaction.commit();
|
||||
return true;
|
||||
}
|
||||
|
||||
// https://tc39.es/proposal-temporal/#prod-CalendarDateTime
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue