Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 0274a79

Browse files
committed
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. PR-URL: #518 Reviewed-By: Seth Brenith <[email protected]> Reviewed-By: Jimmy Thomson <[email protected]>
1 parent ed02928 commit 0274a79

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
@@ -378,7 +378,8 @@
378378
Object.defineProperty(global, 'console', {
379379
configurable: true,
380380
enumerable: false,
381-
value: wrappedConsole
381+
value: wrappedConsole,
382+
writable: true
382383
});
383384
setupInspector(originalConsole, wrappedConsole, CJSModule);
384385
}

0 commit comments

Comments
 (0)