1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:07:36 +00:00

LibJS: Convert MapIterator::create() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-13 20:49:50 +00:00
parent d48cdc7fa6
commit 9846d23c79
2 changed files with 3 additions and 3 deletions

View file

@ -9,9 +9,9 @@
namespace JS { namespace JS {
MapIterator* MapIterator::create(Realm& realm, Map& map, Object::PropertyKind iteration_kind) NonnullGCPtr<MapIterator> MapIterator::create(Realm& realm, Map& map, Object::PropertyKind iteration_kind)
{ {
return realm.heap().allocate<MapIterator>(realm, map, iteration_kind, *realm.intrinsics().map_iterator_prototype()); return *realm.heap().allocate<MapIterator>(realm, map, iteration_kind, *realm.intrinsics().map_iterator_prototype());
} }
MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype) MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype)

View file

@ -16,7 +16,7 @@ class MapIterator final : public Object {
JS_OBJECT(MapIterator, Object); JS_OBJECT(MapIterator, Object);
public: public:
static MapIterator* create(Realm&, Map& map, Object::PropertyKind iteration_kind); static NonnullGCPtr<MapIterator> create(Realm&, Map& map, Object::PropertyKind iteration_kind);
virtual ~MapIterator() override = default; virtual ~MapIterator() override = default;