mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:07:44 +00:00
LibJS: Convert ProxyObject::create() to NonnullGCPtr
This commit is contained in:
parent
6e386acb11
commit
e0818bf21e
3 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ static ThrowCompletionOr<ProxyObject*> proxy_create(VM& vm, Value target, Value
|
||||||
return vm.throw_completion<TypeError>(ErrorType::ProxyConstructorBadType, "target", target.to_string_without_side_effects());
|
return vm.throw_completion<TypeError>(ErrorType::ProxyConstructorBadType, "target", target.to_string_without_side_effects());
|
||||||
if (!handler.is_object())
|
if (!handler.is_object())
|
||||||
return vm.throw_completion<TypeError>(ErrorType::ProxyConstructorBadType, "handler", handler.to_string_without_side_effects());
|
return vm.throw_completion<TypeError>(ErrorType::ProxyConstructorBadType, "handler", handler.to_string_without_side_effects());
|
||||||
return ProxyObject::create(realm, target.as_object(), handler.as_object());
|
return ProxyObject::create(realm, target.as_object(), handler.as_object()).ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyConstructor::ProxyConstructor(Realm& realm)
|
ProxyConstructor::ProxyConstructor(Realm& realm)
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
ProxyObject* ProxyObject::create(Realm& realm, Object& target, Object& handler)
|
NonnullGCPtr<ProxyObject> ProxyObject::create(Realm& realm, Object& target, Object& handler)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<ProxyObject>(realm, target, handler, *realm.intrinsics().object_prototype());
|
return *realm.heap().allocate<ProxyObject>(realm, target, handler, *realm.intrinsics().object_prototype());
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxyObject::ProxyObject(Object& target, Object& handler, Object& prototype)
|
ProxyObject::ProxyObject(Object& target, Object& handler, Object& prototype)
|
||||||
|
|
|
@ -16,7 +16,7 @@ class ProxyObject final : public FunctionObject {
|
||||||
JS_OBJECT(ProxyObject, FunctionObject);
|
JS_OBJECT(ProxyObject, FunctionObject);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static ProxyObject* create(Realm&, Object& target, Object& handler);
|
static NonnullGCPtr<ProxyObject> create(Realm&, Object& target, Object& handler);
|
||||||
|
|
||||||
virtual ~ProxyObject() override = default;
|
virtual ~ProxyObject() override = default;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue