diff options
author | Linus Groh <mail@linusgroh.de> | 2022-02-02 18:55:00 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-02-02 18:55:00 +0000 |
commit | 40ba12aa7d5eee447e099b20dc734b5de68939ac (patch) | |
tree | b3472d877b1ca5824573a78afcd4af19e1397c1c | |
parent | 2a7a8d2cabc225970331279528106380d12b1cdc (diff) | |
download | serenity-40ba12aa7d5eee447e099b20dc734b5de68939ac.zip |
LibJS: Consider calls of parse_iso_date_time() fallible
See: https://github.com/tc39/proposal-temporal/pull/2027
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index f1b61cb6f8..7ce7e96fd1 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -1242,7 +1242,8 @@ ThrowCompletionOr<TemporalInstant> parse_temporal_instant_string(GlobalObject& g } // 3. Let result be ! ParseISODateTime(isoString). - auto result = MUST(parse_iso_date_time(global_object, *parse_result)); + // NOTE: !/? confusion is a spec issue. See: https://github.com/tc39/proposal-temporal/pull/2027 + auto result = TRY(parse_iso_date_time(global_object, *parse_result)); // 4. Let timeZoneResult be ? ParseTemporalTimeZoneString(isoString). auto time_zone_result = TRY(parse_temporal_time_zone_string(global_object, iso_string)); @@ -1278,7 +1279,8 @@ ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_zoned_date_time_string(G } // 3. Let result be ! ParseISODateTime(isoString). - auto result = MUST(parse_iso_date_time(global_object, *parse_result)); + // NOTE: !/? confusion is a spec issue. See: https://github.com/tc39/proposal-temporal/pull/2027 + auto result = TRY(parse_iso_date_time(global_object, *parse_result)); // 4. Let timeZoneResult be ? ParseTemporalTimeZoneString(isoString). auto time_zone_result = TRY(parse_temporal_time_zone_string(global_object, iso_string)); @@ -1560,7 +1562,8 @@ ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_relative_to_string(Globa } // 3. Let result be ! ParseISODateTime(isoString). - auto result = MUST(parse_iso_date_time(global_object, *parse_result)); + // NOTE: !/? confusion is a spec issue. See: https://github.com/tc39/proposal-temporal/pull/2027 + auto result = TRY(parse_iso_date_time(global_object, *parse_result)); bool z; Optional<String> offset_string; |