/* * Copyright (c) 2021, Idan Horowitz * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace JS { NonnullGCPtr SetIterator::create(Realm& realm, Set& set, Object::PropertyKind iteration_kind) { return realm.heap().allocate(realm, set, iteration_kind, *realm.intrinsics().set_iterator_prototype()).release_allocated_value_but_fixme_should_propagate_errors(); } SetIterator::SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype) : Object(ConstructWithPrototypeTag::Tag, prototype) , m_set(set) , m_iteration_kind(iteration_kind) , m_iterator(static_cast(set).begin()) { } void SetIterator::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(&m_set); } }