From 1d7514d51e323be193ac8846da5c25ec3a53ce14 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 12 Jun 2021 01:09:45 +0100 Subject: [PATCH] LibJS: Hide gc() dbgln() behind #ifdef __serenity__ This spams to stdout when using Lagom, and is therefore included in test-js output. Don't need that. --- Userland/Libraries/LibJS/Runtime/GlobalObject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index b1c440af9e..6a7bd4ff7a 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -193,7 +193,9 @@ void GlobalObject::visit_edges(Visitor& visitor) JS_DEFINE_NATIVE_FUNCTION(GlobalObject::gc) { +#ifdef __serenity__ dbgln("Forced garbage collection requested!"); +#endif vm.heap().collect_garbage(); return js_undefined(); }