diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index acac0b3273..db80f0e569 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -46,6 +46,11 @@ Value FunctionDeclaration::execute(Interpreter& interpreter) const Value CallExpression::execute(Interpreter& interpreter) const { + if (name() == "$gc") { + interpreter.heap().collect_garbage(); + return js_undefined(); + } + auto callee = interpreter.global_object().get(name()); ASSERT(callee.is_object()); auto* callee_object = callee.as_object();