mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibJS: Remove redundant TemporalRelativeToString production
This is an editorial change in the Temporal spec.
See: f85f953
This commit is contained in:
parent
51e01b5a80
commit
03017be5bd
4 changed files with 4 additions and 16 deletions
|
@ -247,7 +247,6 @@
|
|||
M(TemporalInvalidPlainTime, "Invalid plain time") \
|
||||
M(TemporalInvalidPlainTimeLikeObject, "Invalid plain time-like object") \
|
||||
M(TemporalInvalidPlainYearMonth, "Invalid plain year month") \
|
||||
M(TemporalInvalidRelativeToString, "Invalid relative to string '{}'") \
|
||||
M(TemporalInvalidTime, "Invalid time") \
|
||||
M(TemporalInvalidTimeString, "Invalid time string '{}'") \
|
||||
M(TemporalInvalidTimeStringUTCDesignator, "Invalid time string '{}': must not contain a UTC designator") \
|
||||
|
|
|
@ -1505,11 +1505,11 @@ ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_relative_to_string(Globa
|
|||
|
||||
// 1. Assert: Type(isoString) is String.
|
||||
|
||||
// 2. If isoString does not satisfy the syntax of a TemporalRelativeToString (see 13.33), then
|
||||
auto parse_result = parse_iso8601(Production::TemporalRelativeToString, iso_string);
|
||||
// 2. If isoString does not satisfy the syntax of a TemporalDateTimeString (see 13.33), then
|
||||
auto parse_result = parse_iso8601(Production::TemporalDateTimeString, iso_string);
|
||||
if (!parse_result.has_value()) {
|
||||
// a. Throw a RangeError exception.
|
||||
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidRelativeToString, iso_string);
|
||||
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidDateTimeString, iso_string);
|
||||
}
|
||||
|
||||
// 3. Let result be ? ParseISODateTime(isoString).
|
||||
|
|
|
@ -1725,14 +1725,6 @@ bool ISO8601Parser::parse_temporal_calendar_string()
|
|||
|| parse_calendar_time();
|
||||
}
|
||||
|
||||
// https://tc39.es/proposal-temporal/#prod-TemporalRelativeToString
|
||||
bool ISO8601Parser::parse_temporal_relative_to_string()
|
||||
{
|
||||
// TemporalRelativeToString :
|
||||
// TemporalDateTimeString
|
||||
return parse_temporal_date_time_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#define JS_ENUMERATE_ISO8601_PRODUCTION_PARSERS \
|
||||
|
@ -1744,8 +1736,7 @@ bool ISO8601Parser::parse_temporal_relative_to_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(TemporalCalendarString, parse_temporal_calendar_string) \
|
||||
__JS_ENUMERATE(TemporalRelativeToString, parse_temporal_relative_to_string)
|
||||
__JS_ENUMERATE(TemporalCalendarString, parse_temporal_calendar_string)
|
||||
|
||||
Optional<ParseResult> parse_iso8601(Production production, StringView input)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,6 @@ enum class Production {
|
|||
TemporalYearMonthString,
|
||||
TemporalZonedDateTimeString,
|
||||
TemporalCalendarString,
|
||||
TemporalRelativeToString,
|
||||
};
|
||||
|
||||
Optional<ParseResult> parse_iso8601(Production, StringView);
|
||||
|
@ -182,7 +181,6 @@ public:
|
|||
[[nodiscard]] bool parse_temporal_year_month_string();
|
||||
[[nodiscard]] bool parse_temporal_zoned_date_time_string();
|
||||
[[nodiscard]] bool parse_temporal_calendar_string();
|
||||
[[nodiscard]] bool parse_temporal_relative_to_string();
|
||||
|
||||
private:
|
||||
struct State {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue