mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-20 09:21:55 +00:00
LibJS: Reject ambiguous annotated time strings
This missing rejection will be caught by an upcoming Temporal.PlainTime test.
This commit is contained in:
parent
c83a3db542
commit
0b59971ef9
Notes:
github-actions[bot]
2024-11-24 00:38:22 +00:00
Author: https://github.com/trflynn89
Commit: 0b59971ef9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2535
2 changed files with 13 additions and 2 deletions
|
@ -199,7 +199,16 @@ public:
|
|||
// AnnotatedTime :::
|
||||
// TimeDesignator Time DateTimeUTCOffset[~Z][opt] TimeZoneAnnotation[opt] Annotations[opt]
|
||||
// Time DateTimeUTCOffset[~Z][opt] TimeZoneAnnotation[opt] Annotations[opt]
|
||||
(void)parse_time_designator();
|
||||
auto has_time_designator = parse_time_designator();
|
||||
|
||||
if (!has_time_designator) {
|
||||
StateTransaction transaction { *this };
|
||||
|
||||
// It is a Syntax Error if ParseText(Time DateTimeUTCOffset[~Z], DateSpecMonthDay) is a Parse Node.
|
||||
// It is a Syntax Error if ParseText(Time DateTimeUTCOffset[~Z], DateSpecYearMonth) is a Parse Node.
|
||||
if (parse_date_spec_month_day() || parse_date_spec_year_month())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!parse_time())
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue