1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +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:
Linus Groh 2021-10-02 23:52:27 +01:00
parent 9b6c09e2c4
commit b7e5f08e56
61 changed files with 326 additions and 686 deletions

View file

@ -54,9 +54,7 @@ Value WeakSetConstructor::construct(FunctionObject& new_target)
if (vm.argument(0).is_nullish())
return weak_set;
auto adder = weak_set->get(vm.names.add);
if (vm.exception())
return {};
auto adder = TRY_OR_DISCARD(weak_set->get(vm.names.add));
if (!adder.is_function()) {
vm.throw_exception<TypeError>(global_object, ErrorType::NotAFunction, "'add' property of WeakSet");
return {};