From 206de2526319df52bba10f75cdc472ae234f902b Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Thu, 29 Aug 2019 13:07:56 -0400 Subject: [PATCH] Ensure that TS can run in a browser by checking for a process obj before using it in the perf logger --- src/compiler/perfLogger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/perfLogger.ts b/src/compiler/perfLogger.ts index 974e231d15d4b..c3efaa75c4a8a 100644 --- a/src/compiler/perfLogger.ts +++ b/src/compiler/perfLogger.ts @@ -38,6 +38,6 @@ namespace ts { /** Performance logger that will generate ETW events if possible */ export const perfLogger: PerfLogger = etwModule ? etwModule : nullLogger; - - perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(process.argv)}`); + const args = typeof process === "undefined" ? [] : process.argv; + perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(args)}`); }