From 6154188786108b253e8c775f728783e9ffa5293f Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 17 Sep 2022 15:34:43 +0530 Subject: perf(ext/console): avoid `wrapConsole` when not inspecting (#15931) --- runtime/js/99_main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runtime/js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index b25022a08..27dc7111a 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -648,6 +648,7 @@ delete Intl.v8BreakIterator; ppid, unstableFlag, cpuCount, + inspectFlag, userAgent: userAgentInfo, } = runtimeOptions; @@ -679,8 +680,10 @@ delete Intl.v8BreakIterator; ObjectDefineProperties(globalThis, mainRuntimeGlobalProperties); ObjectSetPrototypeOf(globalThis, Window.prototype); - const consoleFromDeno = globalThis.console; - wrapConsole(consoleFromDeno, consoleFromV8); + if (inspectFlag) { + const consoleFromDeno = globalThis.console; + wrapConsole(consoleFromDeno, consoleFromV8); + } eventTarget.setEventTargetData(globalThis); -- cgit v1.2.3