We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e90a3a6 commit 8684daeCopy full SHA for 8684dae
lib/internal/freeze_intrinsics.js
@@ -135,7 +135,7 @@ const {
135
136
module.exports = function() {
137
const { Console } = require('internal/console/constructor');
138
- const { console } = require('internal/console/global');
+ const console = require('internal/console/global');
139
const {
140
clearImmediate,
141
clearInterval,
test/parallel/test-freeze-intrinsics.js
@@ -37,3 +37,12 @@ assert.throws(
37
{ name: 'TypeError' });
38
assert.strictEqual(globalThis.globalThis, globalThis);
39
}
40
+
41
+// Ensure that we cannot override console properties.
42
+{
43
+ const { log } = console;
44
45
+ assert.throws(() => { console.log = null; },
46
+ { name: 'TypeError' });
47
+ assert.strictEqual(console.log, log);
48
+}
0 commit comments