Skip to content

Commit 137950b

Browse files
authored
Merge pull request microsoft#19935 from Microsoft/fixDiagnostics
Fix crash when running tsc with -diagnostics
2 parents de7fbc0 + 59fca7f commit 137950b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/performance.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace ts {
1010
namespace ts.performance {
1111
declare const onProfilerEvent: { (markName: string): void; profiler: boolean; };
1212

13-
const profilerEvent: (markName: string) => void = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : noop;
13+
// NOTE: cannot use ts.noop as core.ts loads after this
14+
const profilerEvent: (markName: string) => void = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : () => { /*empty*/ };
1415

1516
let enabled = false;
1617
let profilerStart = 0;

0 commit comments

Comments
 (0)