/src/serenity/Userland/Libraries/LibJS/Runtime/AsyncFromSyncIterator.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2021, David Tuin <davidot@serenityos.org> |
3 | | * Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org> |
4 | | * |
5 | | * SPDX-License-Identifier: BSD-2-Clause |
6 | | */ |
7 | | |
8 | | #include <LibJS/Runtime/AsyncFromSyncIterator.h> |
9 | | #include <LibJS/Runtime/AsyncFromSyncIteratorPrototype.h> |
10 | | #include <LibJS/Runtime/GlobalObject.h> |
11 | | |
12 | | namespace JS { |
13 | | |
14 | | JS_DEFINE_ALLOCATOR(AsyncFromSyncIterator); |
15 | | |
16 | | NonnullGCPtr<AsyncFromSyncIterator> AsyncFromSyncIterator::create(Realm& realm, NonnullGCPtr<IteratorRecord> sync_iterator_record) |
17 | 0 | { |
18 | 0 | return realm.heap().allocate<AsyncFromSyncIterator>(realm, realm, sync_iterator_record); |
19 | 0 | } |
20 | | |
21 | | AsyncFromSyncIterator::AsyncFromSyncIterator(Realm& realm, NonnullGCPtr<IteratorRecord> sync_iterator_record) |
22 | 0 | : Object(ConstructWithPrototypeTag::Tag, realm.intrinsics().async_from_sync_iterator_prototype()) |
23 | 0 | , m_sync_iterator_record(sync_iterator_record) |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | | void AsyncFromSyncIterator::visit_edges(Cell::Visitor& visitor) |
28 | 0 | { |
29 | 0 | Base::visit_edges(visitor); |
30 | 0 | visitor.visit(m_sync_iterator_record); |
31 | 0 | } |
32 | | |
33 | | } |