mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the most used AO of all of them. Definitely worth it though.
This commit is contained in:
@@ -54,9 +54,7 @@ Value SetConstructor::construct(FunctionObject& new_target)
|
||||
if (vm.argument(0).is_nullish())
|
||||
return set;
|
||||
|
||||
auto adder = set->get(vm.names.add);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto adder = TRY_OR_DISCARD(set->get(vm.names.add));
|
||||
if (!adder.is_function()) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotAFunction, "'add' property of Set");
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user