From c3577cac77e3c2b1d4fc863e31076aff876895a1 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 25 Jan 2023 19:42:34 -0800 Subject: [PATCH] Ports the relevant part of ef70a289b855c402d8bf58a7b3766199ab91c7f2 so that 4.9 can run on node19 or something --- src/compiler/watch.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index b06ce9626f08b..bc523822ed4bc 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -60,7 +60,12 @@ namespace ts { export function getLocaleTimeString(system: System) { return !system.now ? new Date().toLocaleTimeString() : - system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }); + // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. + // This branch is solely for testing, so just switch it to a normal space for baseline stability. + // See: + // - https://github.com/nodejs/node/issues/45171 + // - https://github.com/nodejs/node/issues/45753 + system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202f", " "); } /**