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

LibJS: Convert get_options_object() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-15 23:17:20 +01:00
parent f2b5ddd167
commit 08dd1c3e2d
15 changed files with 25 additions and 64 deletions

View file

@ -90,13 +90,11 @@ Value PlainMonthDayConstructor::construct(FunctionObject& new_target)
// 10.2.2 Temporal.PlainMonthDay.from ( item [ , options ] ), https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday.from
JS_DEFINE_NATIVE_FUNCTION(PlainMonthDayConstructor::from)
{
// 1. Set options to ? GetOptionsObject(options).
auto* options = get_options_object(global_object, vm.argument(1));
if (vm.exception())
return {};
auto item = vm.argument(0);
// 1. Set options to ? GetOptionsObject(options).
auto* options = TRY_OR_DISCARD(get_options_object(global_object, vm.argument(1)));
// 2. If Type(item) is Object and item has an [[InitializedTemporalMonthDay]] internal slot, then
if (item.is_object() && is<PlainMonthDay>(item.as_object())) {
// a. Perform ? ToTemporalOverflow(options).