mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Convert Object::construct() to NonnullGCPtr
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:20:49 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/6ae79a84df Pull-request: https://github.com/SerenityOS/serenity/pull/16498 Reviewed-by: https://github.com/trflynn89 ✅
@@ -37,14 +37,14 @@ ThrowCompletionOr<Value> WeakSetConstructor::call()
|
||||
}
|
||||
|
||||
// 24.4.1.1 WeakSet ( [ iterable ] ), https://tc39.es/ecma262/#sec-weakset-iterable
|
||||
ThrowCompletionOr<Object*> WeakSetConstructor::construct(FunctionObject& new_target)
|
||||
ThrowCompletionOr<NonnullGCPtr<Object>> WeakSetConstructor::construct(FunctionObject& new_target)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
auto weak_set = TRY(ordinary_create_from_constructor<WeakSet>(vm, new_target, &Intrinsics::weak_set_prototype));
|
||||
|
||||
if (vm.argument(0).is_nullish())
|
||||
return weak_set.ptr();
|
||||
return weak_set;
|
||||
|
||||
auto adder = TRY(weak_set->get(vm.names.add));
|
||||
if (!adder.is_function())
|
||||
@@ -55,7 +55,7 @@ ThrowCompletionOr<Object*> WeakSetConstructor::construct(FunctionObject& new_tar
|
||||
return {};
|
||||
}));
|
||||
|
||||
return weak_set.ptr();
|
||||
return weak_set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user