summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-05-17 21:14:01 +0100
committerLinus Groh <mail@linusgroh.de>2022-05-17 21:14:01 +0100
commit0946f82c8c86e613df808c9f23879111d4ad313b (patch)
tree2458a0d0b844c36e520c919c01ce822ff0cfb840
parent9b4aabbcf9229eadd9c971ec5eb1b9c7fcd99c55 (diff)
downloadserenity-0946f82c8c86e613df808c9f23879111d4ad313b.zip
LibJS: Combine TemporalTimeZoneIdentifier and TimeZoneBracketedName
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/6db76f4
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.cpp24
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.h3
2 files changed, 8 insertions, 19 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.cpp
index 4154c00ea6..836e90e62c 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.cpp
@@ -950,10 +950,10 @@ bool ISO8601Parser::parse_time_zone_iana_name()
return true;
}
-// https://tc39.es/proposal-temporal/#prod-TimeZoneBracketedName
-bool ISO8601Parser::parse_time_zone_bracketed_name()
+// https://tc39.es/proposal-temporal/#prod-TimeZoneIdentifier
+bool ISO8601Parser::parse_time_zone_identifier()
{
- // TimeZoneBracketedName :
+ // TimeZoneIdentifier :
// TimeZoneIANAName
// TimeZoneUTCOffsetName
StateTransaction transaction { *this };
@@ -970,11 +970,11 @@ bool ISO8601Parser::parse_time_zone_bracketed_name()
bool ISO8601Parser::parse_time_zone_bracketed_annotation()
{
// TimeZoneBracketedAnnotation :
- // [ TimeZoneBracketedName ]
+ // [ TimeZoneIdentifier ]
StateTransaction transaction { *this };
if (!m_state.lexer.consume_specific('['))
return false;
- if (!parse_time_zone_bracketed_name())
+ if (!parse_time_zone_identifier())
return false;
if (!m_state.lexer.consume_specific(']'))
return false;
@@ -1650,24 +1650,14 @@ bool ISO8601Parser::parse_temporal_time_string()
|| parse_calendar_time();
}
-// https://tc39.es/proposal-temporal/#prod-TemporalTimeZoneIdentifier
-bool ISO8601Parser::parse_temporal_time_zone_identifier()
-{
- // TemporalTimeZoneIdentifier :
- // TimeZoneNumericUTCOffset
- // TimeZoneIANAName
- return parse_time_zone_numeric_utc_offset()
- || parse_time_zone_iana_name();
-}
-
// https://tc39.es/proposal-temporal/#prod-TemporalTimeZoneString
bool ISO8601Parser::parse_temporal_time_zone_string()
{
// TemporalTimeZoneString :
- // TemporalTimeZoneIdentifier
+ // TimeZoneIdentifier
// Date TimeSpecSeparator[opt] TimeZone Calendar[opt]
StateTransaction transaction { *this };
- if (!parse_temporal_time_zone_identifier()) {
+ if (!parse_time_zone_identifier()) {
if (!parse_date())
return false;
(void)parse_time_spec_separator();
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.h b/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.h
index fdd7a9a3ba..954b304437 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.h
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/ISO8601.h
@@ -136,7 +136,7 @@ public:
[[nodiscard]] bool parse_time_zone_iana_component();
[[nodiscard]] bool parse_time_zone_iana_name_tail();
[[nodiscard]] bool parse_time_zone_iana_name();
- [[nodiscard]] bool parse_time_zone_bracketed_name();
+ [[nodiscard]] bool parse_time_zone_identifier();
[[nodiscard]] bool parse_time_zone_bracketed_annotation();
[[nodiscard]] bool parse_time_zone_offset_required();
[[nodiscard]] bool parse_time_zone_name_required();
@@ -176,7 +176,6 @@ public:
[[nodiscard]] bool parse_temporal_duration_string();
[[nodiscard]] bool parse_temporal_month_day_string();
[[nodiscard]] bool parse_temporal_time_string();
- [[nodiscard]] bool parse_temporal_time_zone_identifier();
[[nodiscard]] bool parse_temporal_time_zone_string();
[[nodiscard]] bool parse_temporal_year_month_string();
[[nodiscard]] bool parse_temporal_zoned_date_time_string();