@@ -3881,7 +3881,8 @@ module ts {
3881
3881
filename = TypeScript . switchToForwardSlashes ( filename ) ;
3882
3882
var compilerOptions = program . getCompilerOptions ( ) ;
3883
3883
var targetSourceFile = program . getSourceFile ( filename ) ; // Current selected file to be output
3884
- var emitToSingleFile = ts . shouldEmitToOwnFile ( targetSourceFile , compilerOptions ) ;
3884
+ // If --out flag is not specified, shouldEmitToOwnFile is true. Otherwise shouldEmitToOwnFile is false.
3885
+ var shouldEmitToOwnFile = ts . shouldEmitToOwnFile ( targetSourceFile , compilerOptions ) ;
3885
3886
var emitDeclaration = compilerOptions . declaration ;
3886
3887
var emitOutput : EmitOutput = {
3887
3888
outputFiles : [ ] ,
@@ -3902,7 +3903,7 @@ module ts {
3902
3903
var syntacticDiagnostics : Diagnostic [ ] = [ ] ;
3903
3904
var containSyntacticErrors = false ;
3904
3905
3905
- if ( emitToSingleFile ) {
3906
+ if ( shouldEmitToOwnFile ) {
3906
3907
// Check only the file we want to emit
3907
3908
containSyntacticErrors = containErrors ( program . getDiagnostics ( targetSourceFile ) ) ;
3908
3909
} else {
@@ -3929,7 +3930,7 @@ module ts {
3929
3930
// Perform semantic and force a type check before emit to ensure that all symbols are updated
3930
3931
// EmitFiles will report if there is an error from TypeChecker and Emitter
3931
3932
// Depend whether we will have to emit into a single file or not either emit only selected file in the project, emit all files into a single file
3932
- var emitFilesResult = emitToSingleFile ? getFullTypeCheckChecker ( ) . emitFiles ( targetSourceFile ) : getFullTypeCheckChecker ( ) . emitFiles ( ) ;
3933
+ var emitFilesResult = getFullTypeCheckChecker ( ) . emitFiles ( targetSourceFile ) ; ;
3933
3934
emitOutput . emitOutputStatus = emitFilesResult . emitResultStatus ;
3934
3935
3935
3936
// Reset writer back to undefined to make sure that we produce an error message if CompilerHost.writeFile method is called when we are not in getEmitOutput
0 commit comments