diff --git a/Userland/Libraries/LibJS/Runtime/SetIterator.cpp b/Userland/Libraries/LibJS/Runtime/SetIterator.cpp index 5fcdb86f8b..5e4b946e98 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIterator.cpp @@ -9,9 +9,9 @@ namespace JS { -SetIterator* SetIterator::create(Realm& realm, Set& set, Object::PropertyKind iteration_kind) +NonnullGCPtr SetIterator::create(Realm& realm, Set& set, Object::PropertyKind iteration_kind) { - return realm.heap().allocate(realm, set, iteration_kind, *realm.intrinsics().set_iterator_prototype()); + return *realm.heap().allocate(realm, set, iteration_kind, *realm.intrinsics().set_iterator_prototype()); } SetIterator::SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype) diff --git a/Userland/Libraries/LibJS/Runtime/SetIterator.h b/Userland/Libraries/LibJS/Runtime/SetIterator.h index 9caef615b3..8fa3cd9b34 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIterator.h +++ b/Userland/Libraries/LibJS/Runtime/SetIterator.h @@ -16,7 +16,7 @@ class SetIterator final : public Object { JS_OBJECT(SetIterator, Object); public: - static SetIterator* create(Realm&, Set& set, Object::PropertyKind iteration_kind); + static NonnullGCPtr create(Realm&, Set& set, Object::PropertyKind iteration_kind); virtual ~SetIterator() override = default;