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:
parent
4cb6eaf588
commit
3c530dec5a
3 changed files with 4 additions and 7 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue