0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

lib: make sure console is writable

The code currently assumes that `console` is already writable, but
that's only if it was previously defined as writable. If it hasn't
already been defined then the default value is false.

Refs: https://github.com/nodejs/node/pull/17708

PR-URL: https://github.com/nodejs/node/pull/20185
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Kyle Farnung 2018-04-20 18:41:20 -07:00
parent 15fd0d95f8
commit 982adb5994

View File

@ -356,7 +356,8 @@
Object.defineProperty(global, 'console', {
configurable: true,
enumerable: false,
value: wrappedConsole
value: wrappedConsole,
writable: true
});
setupInspector(originalConsole, wrappedConsole, CJSModule);
}