/* * Copyright (c) 2021, David Tuin * Copyright (c) 2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include namespace JS { NonnullGCPtr AsyncFromSyncIterator::create(Realm& realm, Iterator sync_iterator_record) { return realm.heap().allocate(realm, realm, sync_iterator_record); } AsyncFromSyncIterator::AsyncFromSyncIterator(Realm& realm, Iterator sync_iterator_record) : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().async_from_sync_iterator_prototype()) , m_sync_iterator_record(sync_iterator_record) { } void AsyncFromSyncIterator::initialize(Realm& realm) { Object::initialize(realm); } void AsyncFromSyncIterator::visit_edges(Cell::Visitor& visitor) { Object::visit_edges(visitor); visitor.visit(m_sync_iterator_record.iterator); visitor.visit(m_sync_iterator_record.next_method); } }