From 55f6f1c438f3a8f95ab56e99f49de4c465c3963a Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 12 Apr 2026 19:18:46 +0900 Subject: [PATCH] Evaluate console._muted at load time Convert console._muted from a function to a boolean by invoking an IIFE during module initialization. This reads the WScript 'quiet' flag once and stores the result, and updates _echoCallback to reference the boolean (remove the function call). This simplifies usage and avoids repeated runtime checks. --- app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 0ecf4f6..23df447 100644 --- a/app.js +++ b/app.js @@ -36,16 +36,16 @@ var console = { } return res; }, - _muted: function() { + _muted: (function() { try { if (typeof WScript !== "undefined") return WScript.Arguments.Named.Exists("quiet"); } catch (e) { /* ignore */ } return false; - }, + })(), _echoCallback: function(params, type) { - if (this._muted()) return; + if (this._muted) return; if (typeof WScript !== "undefined") { WScript.StdOut.WriteLine("[*] " + params.message);