summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-09-17 15:34:43 +0530
committerGitHub <noreply@github.com>2022-09-17 15:34:43 +0530
commit6154188786108b253e8c775f728783e9ffa5293f (patch)
treec39fd66203fe839d67dbd34309c5045abf1ce1ed /runtime/js
parente7934432ced9674d23d31a4b6973398bd8c8d090 (diff)
perf(ext/console): avoid `wrapConsole` when not inspecting (#15931)
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/99_main.js7
1 files changed, 5 insertions, 2 deletions
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);