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 | 337c55a8937d68fa7c9bc686fce341c8301e96de (patch) | |
tree | 0927529bda29624877efe1cf330cd48e0587b40e | |
parent | c200c247e4ae5e152f8d111043ec63352e3f33b2 (diff) | |
download | serenity-337c55a8937d68fa7c9bc686fce341c8301e96de.zip |
LibJS: Convert StringIterator::create() to NonnullGCPtr
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/StringIterator.cpp | 4 | ||||
-rw-r--r-- | 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> StringIterator::create(Realm& realm, DeprecatedString string) { - return realm.heap().allocate<StringIterator>(realm, move(string), *realm.intrinsics().string_iterator_prototype()); + return *realm.heap().allocate<StringIterator>(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<StringIterator> create(Realm&, DeprecatedString string); virtual ~StringIterator() override = default; |