1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +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

@ -92,15 +92,11 @@ ThrowCompletionOr<PlainMonthDay*> to_temporal_month_day(GlobalObject& global_obj
calendar_absent = calendar_value.is_undefined();
// iv. Set calendar to ? ToTemporalCalendarWithISODefault(calendar).
calendar = to_temporal_calendar_with_iso_default(global_object, calendar_value);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
calendar = TRY(to_temporal_calendar_with_iso_default(global_object, calendar_value));
}
// d. Let fieldNames be ? CalendarFields(calendar, « "day", "month", "monthCode", "year" »).
auto field_names = calendar_fields(global_object, *calendar, { "day"sv, "month"sv, "monthCode"sv, "year"sv });
if (auto* exception = vm.exception())
return throw_completion(exception->value());
auto field_names = TRY(calendar_fields(global_object, *calendar, { "day"sv, "month"sv, "monthCode"sv, "year"sv }));
// e. Let fields be ? PrepareTemporalFields(item, fieldNames, «»).
auto* fields = TRY(prepare_temporal_fields(global_object, item_object, field_names, {}));