mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12: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 :
|
// CalendarTime :
|
||||||
// TimeDesignator TimeSpec TimeZone[opt] Calendar[opt]
|
// TimeDesignator TimeSpec TimeZone[opt] Calendar[opt]
|
||||||
// TimeSpec TimeZone[opt] Calendar
|
// TimeSpecWithOptionalTimeZoneNotAmbiguous Calendar[opt]
|
||||||
// TimeSpecWithOptionalTimeZoneNotAmbiguous
|
|
||||||
{
|
{
|
||||||
StateTransaction transaction { *this };
|
StateTransaction transaction { *this };
|
||||||
if (parse_time_designator() && parse_time_spec()) {
|
if (parse_time_designator() && parse_time_spec()) {
|
||||||
|
@ -1010,17 +1009,12 @@ bool ISO8601Parser::parse_calendar_time()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
StateTransaction transaction { *this };
|
||||||
StateTransaction transaction { *this };
|
if (!parse_time_spec_with_optional_time_zone_not_ambiguous())
|
||||||
if (parse_time_spec()) {
|
return false;
|
||||||
(void)parse_time_zone();
|
(void)parse_calendar();
|
||||||
if (parse_calendar()) {
|
transaction.commit();
|
||||||
transaction.commit();
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return parse_time_spec_with_optional_time_zone_not_ambiguous();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://tc39.es/proposal-temporal/#prod-CalendarDateTime
|
// https://tc39.es/proposal-temporal/#prod-CalendarDateTime
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue