Skip to content

Commit f8f99e2

Browse files
committed
lib: create global console properties at snapshot creation time
1 parent 32ce183 commit f8f99e2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/internal/console/constructor.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,6 @@ Console.prototype.error = Console.prototype.warn;
693693
Console.prototype.groupCollapsed = Console.prototype.group;
694694

695695
function initializeGlobalConsole(globalConsole) {
696-
globalConsole[kBindStreamsLazy](process);
697-
globalConsole[kBindProperties](true, 'auto');
698-
699696
const {
700697
namespace: {
701698
addSerializeCallback,

lib/internal/console/global.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const {
2121

2222
const {
2323
Console,
24+
kBindProperties,
25+
kBindStreamsLazy,
2426
} = require('internal/console/constructor');
2527

2628
const globalConsole = { __proto__: {} };
@@ -41,6 +43,9 @@ for (const prop of ReflectOwnKeys(Console.prototype)) {
4143
ReflectDefineProperty(globalConsole, prop, desc);
4244
}
4345

46+
globalConsole[kBindProperties](true, 'auto');
47+
globalConsole[kBindStreamsLazy](process);
48+
4449
// This is a legacy feature - the Console constructor is exposed on
4550
// the global console instance.
4651
globalConsole.Console = Console;

0 commit comments

Comments
 (0)