Skip to content

Commit 206de25

Browse files
committed
Ensure that TS can run in a browser by checking for a process obj before using it in the perf logger
1 parent fa9e0fa commit 206de25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/perfLogger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ namespace ts {
3838

3939
/** Performance logger that will generate ETW events if possible */
4040
export const perfLogger: PerfLogger = etwModule ? etwModule : nullLogger;
41-
42-
perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(process.argv)}`);
41+
const args = typeof process === "undefined" ? [] : process.argv;
42+
perfLogger.logInfoEvent(`Starting TypeScript v${versionMajorMinor} with command line: ${JSON.stringify(args)}`);
4343
}

0 commit comments

Comments
 (0)