Skip to content

Commit

Permalink
Ensure that TS can run in a browser by checking for a process obj bef…
Browse files Browse the repository at this point in the history
…ore using it in the perf logger (microsoft#33141)
  • Loading branch information
Orta authored and timsuchanek committed Sep 11, 2019
1 parent 13074dc commit ec4ff16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/perfLogger.ts
Expand Up @@ -38,6 +38,6 @@ namespace ts {

/** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */
export const perfLogger: PerfLogger = etwModule && etwModule.logEvent ? 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)}`);
}

0 comments on commit ec4ff16

Please sign in to comment.