mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +00:00
LibJS: Make it possible to visit the edges of an ExecutionContext
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <LibJS/Runtime/ExecutionContext.h>
|
||||
#include <LibJS/Runtime/FunctionObject.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
@@ -38,4 +39,20 @@ ExecutionContext ExecutionContext::copy() const
|
||||
return copy;
|
||||
}
|
||||
|
||||
void ExecutionContext::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
visitor.visit(function);
|
||||
visitor.visit(realm);
|
||||
visitor.visit(variable_environment);
|
||||
visitor.visit(lexical_environment);
|
||||
visitor.visit(private_environment);
|
||||
visitor.visit(context_owner);
|
||||
visitor.visit(this_value);
|
||||
script_or_module.visit(
|
||||
[](Empty) {},
|
||||
[&](auto& script_or_module) {
|
||||
visitor.visit(script_or_module);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user