Skip to content
Browse files

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: #17708

PR-URL: #20185
Reviewed-By: Anna Henningsen <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: Ruben Bridgewater <>
Reviewed-By: Trivikram Kamat <>
Reviewed-By: James M Snell <>
  • Loading branch information
kfarnung committed Apr 24, 2018
1 parent 15fd0d9 commit 982adb5994e940de68df5d71e2b88a3cf89f29d7
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/internal/bootstrap/node.js
@@ -356,7 +356,8 @@
Object.defineProperty(global, 'console', {
configurable: true,
enumerable: false,
value: wrappedConsole
value: wrappedConsole,
writable: true
setupInspector(originalConsole, wrappedConsole, CJSModule);

0 comments on commit 982adb5

Please sign in to comment.
You can’t perform that action at this time.