1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibJS: Convert parse_temporal_date_time_string() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-16 17:52:57 +01:00
parent 4cb6eaf588
commit 3c530dec5a
3 changed files with 4 additions and 7 deletions

View file

@ -204,10 +204,7 @@ PlainDateTime* to_temporal_date_time(GlobalObject& global_object, Value item, Ob
return {};
// c. Let result be ? ParseTemporalDateTimeString(string).
auto maybe_result = parse_temporal_date_time_string(global_object, string);
if (vm.exception())
return {};
result = move(*maybe_result);
result = TRY_OR_DISCARD(parse_temporal_date_time_string(global_object, string));
// d. Assert: ! IsValidISODate(result.[[Year]], result.[[Month]], result.[[Day]]) is true.
VERIFY(is_valid_iso_date(result.year, result.month, result.day));