Skip to content

Commit 3b896f5

Browse files
author
Yui T
committed
Dix throwing exception from emitting file
1 parent 37a839f commit 3b896f5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/compiler/emitter.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,13 +3243,15 @@ module ts {
32433243
emitFile(compilerOptions.out);
32443244
}
32453245
} else {
3246-
// targetSourceFile is specified (e.g calling emitter from language service)
3247-
if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) {
3246+
// targetSourceFile is specified (e.g calling emitter from language service or user language service getSemanticDiagnostic)
3247+
var shouldEmitTargetToOwnFile = shouldEmitToOwnFile(targetSourceFile, compilerOptions);
3248+
if (shouldEmitTargetToOwnFile) {
32483249
// If shouldEmitToOwnFile is true or targetSourceFile is an external module file, then emit targetSourceFile in its own output file
32493250
var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, ".js");
32503251
emitFile(jsFilePath, targetSourceFile);
3251-
} else {
3252-
// If shouldEmitToOwnFile is false, then emit all, non-external-module file, into one single output file
3252+
}
3253+
else if (!shouldEmitTargetToOwnFile && compilerOptions.out) {
3254+
// If shouldEmitToOwnFile is false and --out is specified, then emit all, non-external-module file, into one single output file
32533255
emitFile(compilerOptions.out);
32543256
}
32553257
}

0 commit comments

Comments
 (0)