From b2b06458051c6af5f32959adbb0f6a1b2364765e Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 10 Jan 2019 01:55:07 +0800 Subject: [PATCH] console: create the global console from Console constructor Specifically for v11.x. PR-URL: https://github.com/nodejs/node/pull/25420 Refs: https://github.com/nodejs/node/pull/23509 Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen --- lib/console.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/console.js b/lib/console.js index 53297c901cd336..32713ec5556d03 100644 --- a/lib/console.js +++ b/lib/console.js @@ -487,7 +487,8 @@ function noop() {} // we cannot actually use `new Console` to construct the global console. // Therefore, the console.Console.prototype is not // in the global console prototype chain anymore. -const globalConsole = Object.create({}); +// This is only here for v11.x conflict resolution. +const globalConsole = Object.create(Console.prototype); const tempConsole = new Console({ stdout: process.stdout, stderr: process.stderr