AsyncGenerator.cpp 650 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/AsyncGenerator.h>
  7. #include <LibJS/Runtime/AsyncGeneratorPrototype.h>
  8. #include <LibJS/Runtime/GlobalObject.h>
  9. namespace JS {
  10. AsyncGenerator::AsyncGenerator(Object& prototype)
  11. : Object(prototype)
  12. {
  13. }
  14. void AsyncGenerator::visit_edges(Cell::Visitor& visitor)
  15. {
  16. Base::visit_edges(visitor);
  17. for (auto const& request : m_async_generator_queue) {
  18. if (request.completion.value().has_value())
  19. visitor.visit(*request.completion.value());
  20. visitor.visit(request.capability);
  21. }
  22. }
  23. }