Skip to content

Commit 9eacd66

Browse files
kfarnungMylesBorins
authored andcommitted
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent bd2e521 commit 9eacd66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/bootstrap/node.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@
356356
Object.defineProperty(global, 'console', {
357357
configurable: true,
358358
enumerable: false,
359-
value: wrappedConsole
359+
value: wrappedConsole,
360+
writable: true
360361
});
361362
setupInspector(originalConsole, wrappedConsole, CJSModule);
362363
}

0 commit comments

Comments
 (0)