summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-13 20:49:50 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-14 09:59:45 +0000
commit9846d23c79f97d7a14a9ebc38483de1414941693 (patch)
treef1c497c56dfc12af1052d5754e867467f37242a8 /Userland/Libraries/LibJS
parentd48cdc7fa6fd21579810d5db40f460cf358be597 (diff)
downloadserenity-9846d23c79f97d7a14a9ebc38483de1414941693.zip
LibJS: Convert MapIterator::create() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Runtime/MapIterator.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/MapIterator.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/MapIterator.cpp b/Userland/Libraries/LibJS/Runtime/MapIterator.cpp
index 33fb1357ad..3ac21cfb64 100644
--- a/Userland/Libraries/LibJS/Runtime/MapIterator.cpp
+++ b/Userland/Libraries/LibJS/Runtime/MapIterator.cpp
@@ -9,9 +9,9 @@
namespace JS {
-MapIterator* MapIterator::create(Realm& realm, Map& map, Object::PropertyKind iteration_kind)
+NonnullGCPtr<MapIterator> MapIterator::create(Realm& realm, Map& map, Object::PropertyKind iteration_kind)
{
- return realm.heap().allocate<MapIterator>(realm, map, iteration_kind, *realm.intrinsics().map_iterator_prototype());
+ return *realm.heap().allocate<MapIterator>(realm, map, iteration_kind, *realm.intrinsics().map_iterator_prototype());
}
MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype)
diff --git a/Userland/Libraries/LibJS/Runtime/MapIterator.h b/Userland/Libraries/LibJS/Runtime/MapIterator.h
index 54641fa2ca..3d3a2e1e18 100644
--- a/Userland/Libraries/LibJS/Runtime/MapIterator.h
+++ b/Userland/Libraries/LibJS/Runtime/MapIterator.h
@@ -16,7 +16,7 @@ class MapIterator final : public Object {
JS_OBJECT(MapIterator, Object);
public:
- static MapIterator* create(Realm&, Map& map, Object::PropertyKind iteration_kind);
+ static NonnullGCPtr<MapIterator> create(Realm&, Map& map, Object::PropertyKind iteration_kind);
virtual ~MapIterator() override = default;