瀏覽代碼

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.
Linus Groh 4 年之前
父節點
當前提交
1d7514d51e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibJS/Runtime/GlobalObject.cpp

+ 2 - 0
Userland/Libraries/LibJS/Runtime/GlobalObject.cpp

@@ -193,7 +193,9 @@ void GlobalObject::visit_edges(Visitor& visitor)
 
 
 JS_DEFINE_NATIVE_FUNCTION(GlobalObject::gc)
 JS_DEFINE_NATIVE_FUNCTION(GlobalObject::gc)
 {
 {
+#ifdef __serenity__
     dbgln("Forced garbage collection requested!");
     dbgln("Forced garbage collection requested!");
+#endif
     vm.heap().collect_garbage();
     vm.heap().collect_garbage();
     return js_undefined();
     return js_undefined();
 }
 }