summaryrefslogtreecommitdiff
path: root/Userland/Libraries
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
commit4763cab32331590befcc4840fb1c03f93f86e2ed (patch)
treed684d7c3e9085474e69c4c58915bd91a5bf65d11 /Userland/Libraries
parent947ea92bf6f02fc1f921f2b0e1d37b88d342f004 (diff)
downloadserenity-4763cab32331590befcc4840fb1c03f93f86e2ed.zip
LibJS: Convert ArrayIterator::create() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayIterator.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp
index b9e45758ec..39d428d412 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp
@@ -9,9 +9,9 @@
namespace JS {
-ArrayIterator* ArrayIterator::create(Realm& realm, Value array, Object::PropertyKind iteration_kind)
+NonnullGCPtr<ArrayIterator> ArrayIterator::create(Realm& realm, Value array, Object::PropertyKind iteration_kind)
{
- return realm.heap().allocate<ArrayIterator>(realm, array, iteration_kind, *realm.intrinsics().array_iterator_prototype());
+ return *realm.heap().allocate<ArrayIterator>(realm, array, iteration_kind, *realm.intrinsics().array_iterator_prototype());
}
ArrayIterator::ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype)
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIterator.h b/Userland/Libraries/LibJS/Runtime/ArrayIterator.h
index e296a85d0d..7bee8031ad 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayIterator.h
+++ b/Userland/Libraries/LibJS/Runtime/ArrayIterator.h
@@ -14,7 +14,7 @@ class ArrayIterator final : public Object {
JS_OBJECT(ArrayIterator, Object);
public:
- static ArrayIterator* create(Realm&, Value array, Object::PropertyKind iteration_kind);
+ static NonnullGCPtr<ArrayIterator> create(Realm&, Value array, Object::PropertyKind iteration_kind);
virtual ~ArrayIterator() override = default;