Merge pull request #19935 from Microsoft/fixDiagnostics

Fix crash when running tsc with -diagnostics
This commit is contained in:
Ron Buckton 2017-11-10 16:29:52 -08:00 committed by GitHub
commit 137950b406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;