/* * Copyright (c) 2021, Idan Horowitz * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace JS { NonnullGCPtr MapIterator::create(Realm& realm, Map& map, Object::PropertyKind iteration_kind) { return *realm.heap().allocate(realm, map, iteration_kind, *realm.intrinsics().map_iterator_prototype()); } MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype) : Object(prototype) , m_map(map) , m_iteration_kind(iteration_kind) , m_iterator(static_cast(map).begin()) { } void MapIterator::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(&m_map); } }