From 10cc60fc91af215fa7f9099a94d160d06ef18e4c Mon Sep 17 00:00:00 2001 From: sinkhaha <1468709106@qq.com> Date: Thu, 25 May 2023 11:00:41 +0800 Subject: [PATCH] lib: use existing `isWindows` variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/48134 Reviewed-By: Tobias Nießen Reviewed-By: Antoine du Hamel Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Darshan Sen Reviewed-By: Mestery Reviewed-By: Rich Trott Reviewed-By: Gerhard Stöbich --- lib/internal/errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index ec03ead14623f6..df3fcb13873015 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -787,7 +787,7 @@ const fatalExceptionStackEnhancers = { // However, fatal error are handled differently and we cannot easily // highlight them. On Windows, detecting whether a console supports // ANSI escape sequences is not reliable. - if (process.platform === 'win32') { + if (isWindows) { const info = internalBinding('os').getOSInformation(); const ver = ArrayPrototypeMap(StringPrototypeSplit(info[2], '.'), Number);