mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-26 02:44:14 +00:00 
			
		
		
		
	 fc9d587e39
			
		
	
	
		fc9d587e39
		
	
	
	
	
		
			
			A struct with three raw pointers to other GC'd types is a pretty big liability, let's just turn this into a Cell itself. This comes with the additional benefit of being able to capture it in a lambda effortlessly, without having to create handles for individual members.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			650 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			650 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibJS/Runtime/AsyncGenerator.h>
 | |
| #include <LibJS/Runtime/AsyncGeneratorPrototype.h>
 | |
| #include <LibJS/Runtime/GlobalObject.h>
 | |
| 
 | |
| namespace JS {
 | |
| 
 | |
| AsyncGenerator::AsyncGenerator(Object& prototype)
 | |
|     : Object(prototype)
 | |
| {
 | |
| }
 | |
| 
 | |
| void AsyncGenerator::visit_edges(Cell::Visitor& visitor)
 | |
| {
 | |
|     Base::visit_edges(visitor);
 | |
|     for (auto const& request : m_async_generator_queue) {
 | |
|         if (request.completion.value().has_value())
 | |
|             visitor.visit(*request.completion.value());
 | |
|         visitor.visit(request.capability);
 | |
|     }
 | |
| }
 | |
| 
 | |
| }
 |