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

Commit f82e85b

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 <sethb@microsoft.com> Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
1 parent c68529e commit f82e85b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/bootstrap/node.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@
377377
Object.defineProperty(global, 'console', {
378378
configurable: true,
379379
enumerable: false,
380-
value: wrappedConsole
380+
value: wrappedConsole,
381+
writable: true
381382
});
382383
setupInspector(originalConsole, wrappedConsole, CJSModule);
383384
}

0 commit comments

Comments
 (0)