From deea68cbb2e4e5062453e3140eb2862e287f6267 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Wed, 2 Aug 2017 12:19:42 +0800 Subject: [PATCH] inspector: fix console with inspector disabled PR-URL: https://github.com/nodejs/node/pull/14489 Reviewed-By: James M Snell Reviewed-By: Refael Ackermann --- lib/internal/bootstrap_node.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 0c82e5e36d6f43..128be6f1e8a360 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -287,6 +287,9 @@ function installInspectorConsole(globalConsole) { const wrappedConsole = NativeModule.require('console'); const inspector = process.binding('inspector'); + if (!inspector.consoleCall) { + return wrappedConsole; + } const config = {}; for (const key of Object.keys(wrappedConsole)) { if (!globalConsole.hasOwnProperty(key))