diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-13 20:49:50 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-14 09:59:45 +0000 |
commit | e0818bf21e08f142516dca4c9aca1e86b6cd67ed (patch) | |
tree | 51da3074151f588b9b0e03559d623bf5f650e3f7 /Userland/Libraries | |
parent | 6e386acb11bf06ec6543c6120cd595786ba339a7 (diff) | |
download | serenity-e0818bf21e08f142516dca4c9aca1e86b6cd67ed.zip |
LibJS: Convert ProxyObject::create() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ProxyObject.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ProxyObject.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp index 291bf5edb5..e7dcd95d7c 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp @@ -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()); if (!handler.is_object()) 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) diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp index a1efa6326e..c8e79102af 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -15,9 +15,9 @@ 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) diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.h b/Userland/Libraries/LibJS/Runtime/ProxyObject.h index c7ac85170b..21868c8792 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyObject.h +++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.h @@ -16,7 +16,7 @@ class ProxyObject final : public FunctionObject { JS_OBJECT(ProxyObject, FunctionObject); public: - static ProxyObject* create(Realm&, Object& target, Object& handler); + static NonnullGCPtr<ProxyObject> create(Realm&, Object& target, Object& handler); virtual ~ProxyObject() override = default; |