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 | cac71a6847480df27ee0fbabea291949c2987994 (patch) | |
tree | 8840eb7331e3fb34d7a4f861a46b5fc05a29a69d /Userland/Libraries/LibJS/Runtime/WeakRef.cpp | |
parent | 3358ddfd0e93ed36d2b31f7db4fcc2d236584edf (diff) | |
download | serenity-cac71a6847480df27ee0fbabea291949c2987994.zip |
LibJS: Convert WeakRef::create() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/WeakRef.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/WeakRef.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp index 023ccbcbd4..7ec917f3d9 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp @@ -8,14 +8,14 @@ namespace JS { -WeakRef* WeakRef::create(Realm& realm, Object& value) +NonnullGCPtr<WeakRef> WeakRef::create(Realm& realm, Object& value) { - return realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype()); + return *realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype()); } -WeakRef* WeakRef::create(Realm& realm, Symbol& value) +NonnullGCPtr<WeakRef> WeakRef::create(Realm& realm, Symbol& value) { - return realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype()); + return *realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype()); } WeakRef::WeakRef(Object& value, Object& prototype) |