Ver Fonte

LibJS: Convert SetIterator::create() to NonnullGCPtr

Linus Groh há 2 anos atrás
pai
commit
c200c247e4

+ 2 - 2
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> SetIterator::create(Realm& realm, Set& set, Object::PropertyKind iteration_kind)
 {
-    return realm.heap().allocate<SetIterator>(realm, set, iteration_kind, *realm.intrinsics().set_iterator_prototype());
+    return *realm.heap().allocate<SetIterator>(realm, set, iteration_kind, *realm.intrinsics().set_iterator_prototype());
 }
 
 SetIterator::SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype)

+ 1 - 1
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<SetIterator> create(Realm&, Set& set, Object::PropertyKind iteration_kind);
 
     virtual ~SetIterator() override = default;