inspector: fix console with inspector disabled

PR-URL: https://github.com/nodejs/node/pull/14489
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
Timothy Gu 2017-08-02 12:19:42 +08:00
parent 365b2e3424
commit 17547c4762
No known key found for this signature in database
GPG Key ID: 7FE6B095B582B0D4

View File

@ -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))