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

LibJS: Convert PlainMonthDay AOs to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-09-16 02:11:23 +03:00 committed by Linus Groh
parent 229a5ce149
commit 5ea1810ada
5 changed files with 33 additions and 49 deletions

View file

@ -90,7 +90,7 @@ Value PlainMonthDayConstructor::construct(FunctionObject& new_target)
}
// 7. Return ? CreateTemporalMonthDay(m, d, calendar, ref, NewTarget).
return create_temporal_month_day(global_object, m, d, *calendar, ref, &new_target);
return TRY_OR_DISCARD(create_temporal_month_day(global_object, m, d, *calendar, ref, &new_target));
}
// 10.2.2 Temporal.PlainMonthDay.from ( item [ , options ] ), https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday.from
@ -113,11 +113,11 @@ JS_DEFINE_NATIVE_FUNCTION(PlainMonthDayConstructor::from)
auto& plain_month_day_object = static_cast<PlainMonthDay&>(item.as_object());
// b. Return ? CreateTemporalMonthDay(item.[[ISOMonth]], item.[[ISODay]], item.[[Calendar]], item.[[ISOYear]]).
return create_temporal_month_day(global_object, plain_month_day_object.iso_month(), plain_month_day_object.iso_day(), plain_month_day_object.calendar(), plain_month_day_object.iso_year());
return TRY_OR_DISCARD(create_temporal_month_day(global_object, plain_month_day_object.iso_month(), plain_month_day_object.iso_day(), plain_month_day_object.calendar(), plain_month_day_object.iso_year()));
}
// 3. Return ? ToTemporalMonthDay(item, options).
return to_temporal_month_day(global_object, item, options);
return TRY_OR_DISCARD(to_temporal_month_day(global_object, item, options));
}
}