diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-09-17 15:34:43 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 15:34:43 +0530 |
commit | 6154188786108b253e8c775f728783e9ffa5293f (patch) | |
tree | c39fd66203fe839d67dbd34309c5045abf1ce1ed /runtime/js | |
parent | e7934432ced9674d23d31a4b6973398bd8c8d090 (diff) |
perf(ext/console): avoid `wrapConsole` when not inspecting (#15931)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/99_main.js | 7 |
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); |