From 59fca7fc30bfbcdde8d5b3e544bdf09da5fa9e9a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 10 Nov 2017 16:26:16 -0800 Subject: [PATCH] Fix crash when running tsc with -diagnostics --- src/compiler/performance.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/performance.ts b/src/compiler/performance.ts index 225b34de9c..104148ed4a 100644 --- a/src/compiler/performance.ts +++ b/src/compiler/performance.ts @@ -10,7 +10,8 @@ namespace ts { namespace ts.performance { declare const onProfilerEvent: { (markName: string): void; profiler: boolean; }; - const profilerEvent: (markName: string) => void = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : noop; + // NOTE: cannot use ts.noop as core.ts loads after this + const profilerEvent: (markName: string) => void = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : () => { /*empty*/ }; let enabled = false; let profilerStart = 0;