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
Notes: sideshowbarker 2024-07-17 16:23:06 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -9,9 +9,9 @@
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)

View file

@ -16,7 +16,7 @@ class MapIterator final : public Object {
JS_OBJECT(MapIterator, Object);
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;