mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibJS: Make PromiseCapability GC-allocated
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.
This commit is contained in:
@@ -21,9 +21,7 @@ void AsyncGenerator::visit_edges(Cell::Visitor& visitor)
|
||||
for (auto const& request : m_async_generator_queue) {
|
||||
if (request.completion.value().has_value())
|
||||
visitor.visit(*request.completion.value());
|
||||
visitor.visit(request.capability.promise);
|
||||
visitor.visit(request.capability.reject);
|
||||
visitor.visit(request.capability.resolve);
|
||||
visitor.visit(request.capability);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user