From b90c5f2ca4732cde157967a01eeffb841d59d0b4 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 8 Oct 2014 10:26:39 -0700 Subject: [PATCH] Address code review --- src/compiler/emitter.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 61ff5f90906..c21f824e64d 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3243,15 +3243,14 @@ module ts { emitFile(compilerOptions.out); } } else { - // targetSourceFile is specified (e.g calling emitter from language service or user language service getSemanticDiagnostic) - var shouldEmitTargetToOwnFile = shouldEmitToOwnFile(targetSourceFile, compilerOptions); - if (shouldEmitTargetToOwnFile) { - // If shouldEmitToOwnFile is true or targetSourceFile is an external module file, then emit targetSourceFile in its own output file + // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) + if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { + // If shouldEmitToOwnFile return true or targetSourceFile is an external module file, then emit targetSourceFile in its own output file var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, ".js"); emitFile(jsFilePath, targetSourceFile); } - else if (!shouldEmitTargetToOwnFile && compilerOptions.out) { - // If shouldEmitToOwnFile is false and --out is specified, then emit all, non-external-module file, into one single output file + else if (compilerOptions.out) { + // Otherwise, if --out is specified and targetSourceFile shouldn't be emitted to own file, then emit all, non-external-module file, into one single output file emitFile(compilerOptions.out); } }