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 | 3358ddfd0e93ed36d2b31f7db4fcc2d236584edf (patch) | |
tree | 7a1c59f907ffe93aa475bb68bd2d8dbe8788e4c4 | |
parent | 37c85fa07e7ed5d1e34c855f5479528b47da2627 (diff) | |
download | serenity-3358ddfd0e93ed36d2b31f7db4fcc2d236584edf.zip |
LibJS: Convert WeakMap::create() to NonnullGCPtr
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/WeakMap.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/WeakMap.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/WeakMap.cpp b/Userland/Libraries/LibJS/Runtime/WeakMap.cpp index 0169bdf1c1..f4e52c0cc8 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMap.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMap.cpp @@ -8,9 +8,9 @@ namespace JS { -WeakMap* WeakMap::create(Realm& realm) +NonnullGCPtr<WeakMap> WeakMap::create(Realm& realm) { - return realm.heap().allocate<WeakMap>(realm, *realm.intrinsics().weak_map_prototype()); + return *realm.heap().allocate<WeakMap>(realm, *realm.intrinsics().weak_map_prototype()); } WeakMap::WeakMap(Object& prototype) diff --git a/Userland/Libraries/LibJS/Runtime/WeakMap.h b/Userland/Libraries/LibJS/Runtime/WeakMap.h index 832de588cb..ac0b516dba 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMap.h +++ b/Userland/Libraries/LibJS/Runtime/WeakMap.h @@ -19,7 +19,7 @@ class WeakMap final JS_OBJECT(WeakMap, Object); public: - static WeakMap* create(Realm&); + static NonnullGCPtr<WeakMap> create(Realm&); virtual ~WeakMap() override = default; |