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

LibJS: Convert Calendar AOs to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-16 21:42:01 +01:00
parent dea43d88e7
commit f8d92232c8
22 changed files with 349 additions and 416 deletions

View file

@ -63,9 +63,7 @@ Value ZonedDateTimeConstructor::construct(FunctionObject& new_target)
auto* time_zone = TRY_OR_DISCARD(to_temporal_time_zone(global_object, vm.argument(1)));
// 5. Let calendar be ? ToTemporalCalendarWithISODefault(calendarLike).
auto* calendar = to_temporal_calendar_with_iso_default(global_object, vm.argument(2));
if (vm.exception())
return {};
auto* calendar = TRY_OR_DISCARD(to_temporal_calendar_with_iso_default(global_object, vm.argument(2)));
// 6. Return ? CreateTemporalZonedDateTime(epochNanoseconds, timeZone, calendar, NewTarget).
return TRY_OR_DISCARD(create_temporal_zoned_date_time(global_object, *epoch_nanoseconds, *time_zone, *calendar, &new_target));