From 337c55a8937d68fa7c9bc686fce341c8301e96de Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 13 Dec 2022 20:49:50 +0000 Subject: LibJS: Convert StringIterator::create() to NonnullGCPtr --- Userland/Libraries/LibJS/Runtime/StringIterator.cpp | 4 ++-- Userland/Libraries/LibJS/Runtime/StringIterator.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/StringIterator.cpp b/Userland/Libraries/LibJS/Runtime/StringIterator.cpp index db505c4db7..0dac262bb1 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIterator.cpp @@ -10,9 +10,9 @@ namespace JS { -StringIterator* StringIterator::create(Realm& realm, DeprecatedString string) +NonnullGCPtr StringIterator::create(Realm& realm, DeprecatedString string) { - return realm.heap().allocate(realm, move(string), *realm.intrinsics().string_iterator_prototype()); + return *realm.heap().allocate(realm, move(string), *realm.intrinsics().string_iterator_prototype()); } StringIterator::StringIterator(DeprecatedString string, Object& prototype) diff --git a/Userland/Libraries/LibJS/Runtime/StringIterator.h b/Userland/Libraries/LibJS/Runtime/StringIterator.h index f2869fa53f..f419caabc4 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIterator.h +++ b/Userland/Libraries/LibJS/Runtime/StringIterator.h @@ -15,7 +15,7 @@ class StringIterator final : public Object { JS_OBJECT(StringIterator, Object); public: - static StringIterator* create(Realm&, DeprecatedString string); + static NonnullGCPtr create(Realm&, DeprecatedString string); virtual ~StringIterator() override = default; -- cgit v1.2.3