From a020a43216a085695a318373be0dc2f4b04be561 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 25 Feb 2015 16:45:45 -0800 Subject: [PATCH] Ensure that the cost for typechecking is not billed to the emit portion of the compiler. --- src/compiler/program.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index b74ef039fd..a8e5b0b3a7 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -177,10 +177,15 @@ module ts { return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; } + // Create the emit resolver outside of the "emitTime" tracking code below. That way + // any cost associated with it (like type checking) are appropriate associated with + // the type-checking counter. + var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + var start = new Date().getTime(); var emitResult = emitFiles( - getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile), + emitResolver, getEmitHost(writeFileCallback), sourceFile);