Ensure that TS can run in a browser by checking for a process obj before using it in the perf logger

This commit is contained in:
Orta Therox
2019-08-29 13:07:56 -04:00
parent fa9e0fa8e8
commit 206de25263
+2 -2
View File
@@ -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)}`);
}