mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Simplify ParseTemporalTimeZoneString
This is an editorial change in the Temporal spec.
See: eec8efab
This commit is contained in:
parent
0c61552b81
commit
d38aeddd77
Notes:
sideshowbarker
2024-07-17 05:18:20 +09:00
Author: https://github.com/IdanHo
Commit: d38aeddd77
Pull-request: https://github.com/SerenityOS/serenity/pull/15709
Reviewed-by: https://github.com/linusg ✅
3 changed files with 21 additions and 52 deletions
|
@ -1400,25 +1400,6 @@ bool ISO8601Parser::parse_temporal_time_string()
|
|||
|| parse_calendar_time();
|
||||
}
|
||||
|
||||
// https://tc39.es/proposal-temporal/#prod-TemporalTimeZoneString
|
||||
bool ISO8601Parser::parse_temporal_time_zone_string()
|
||||
{
|
||||
// TemporalTimeZoneString :
|
||||
// TimeZoneIdentifier
|
||||
// Date TimeSpecSeparator[opt] TimeZone Calendar[opt]
|
||||
StateTransaction transaction { *this };
|
||||
if (!parse_time_zone_identifier()) {
|
||||
if (!parse_date())
|
||||
return false;
|
||||
(void)parse_time_spec_separator();
|
||||
if (!parse_time_zone())
|
||||
return false;
|
||||
(void)parse_calendar();
|
||||
}
|
||||
transaction.commit();
|
||||
return true;
|
||||
}
|
||||
|
||||
// https://tc39.es/proposal-temporal/#prod-TemporalYearMonthString
|
||||
bool ISO8601Parser::parse_temporal_year_month_string()
|
||||
{
|
||||
|
@ -1455,9 +1436,9 @@ bool ISO8601Parser::parse_temporal_zoned_date_time_string()
|
|||
__JS_ENUMERATE(TemporalDurationString, parse_temporal_duration_string) \
|
||||
__JS_ENUMERATE(TemporalMonthDayString, parse_temporal_month_day_string) \
|
||||
__JS_ENUMERATE(TemporalTimeString, parse_temporal_time_string) \
|
||||
__JS_ENUMERATE(TemporalTimeZoneString, parse_temporal_time_zone_string) \
|
||||
__JS_ENUMERATE(TemporalYearMonthString, parse_temporal_year_month_string) \
|
||||
__JS_ENUMERATE(TemporalZonedDateTimeString, parse_temporal_zoned_date_time_string) \
|
||||
__JS_ENUMERATE(TimeZoneIdentifier, parse_time_zone_identifier) \
|
||||
__JS_ENUMERATE(TimeZoneNumericUTCOffset, parse_time_zone_numeric_utc_offset) \
|
||||
__JS_ENUMERATE(CalendarName, parse_calendar_name) \
|
||||
__JS_ENUMERATE(DateMonth, parse_date_month)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue