Skip to content

Commit 9b8be7c

Browse files
TypeScript Botandrewbranch
TypeScript Bot
authored andcommitted
Cherry-pick PR #33141 into release-3.6 (#33247)
Component commits: 206de25 Ensure that TS can run in a browser by checking for a process obj before using it in the perf logger 45227ee Merge branch 'master' into allow_running_in_web
1 parent 1ec17a8 commit 9b8be7c

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 - check for `logEvent` member, as `etwModule` will be `{}` when browserified */
4040
export const perfLogger: PerfLogger = etwModule && etwModule.logEvent ? 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)