/* * Copyright (c) 2021, David Tuin * Copyright (c) 2022-2023, 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).release_allocated_value_but_fixme_should_propagate_errors(); } 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) { } ThrowCompletionOr AsyncFromSyncIterator::initialize(Realm& realm) { MUST_OR_THROW_OOM(Base::initialize(realm)); return {}; } void AsyncFromSyncIterator::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(m_sync_iterator_record.iterator); visitor.visit(m_sync_iterator_record.next_method); } }