@@ -323,35 +323,36 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
323
323
let modulekind = compilerOptions . module ? compilerOptions . module : languageVersion === ScriptTarget . ES6 ? ModuleKind . ES6 : ModuleKind . None ;
324
324
let sourceMapDataList : SourceMapData [ ] = compilerOptions . sourceMap || compilerOptions . inlineSourceMap ? [ ] : undefined ;
325
325
let diagnostics : Diagnostic [ ] = [ ] ;
326
+ let emitSkipped = false ;
326
327
let newLine = host . getNewLine ( ) ;
327
328
328
329
if ( targetSourceFile === undefined ) {
329
330
forEach ( host . getSourceFiles ( ) , sourceFile => {
330
331
if ( shouldEmitToOwnFile ( sourceFile , compilerOptions ) ) {
331
- emitFile ( getEmitFileNames ( sourceFile , host ) , sourceFile ) ;
332
+ emitSkipped = emitFile ( getEmitFileNames ( sourceFile , host ) , sourceFile ) || emitSkipped ;
332
333
}
333
334
} ) ;
334
335
335
336
if ( compilerOptions . outFile || compilerOptions . out ) {
336
- emitFile ( getBundledEmitFileNames ( compilerOptions ) ) ;
337
+ emitSkipped = emitFile ( getBundledEmitFileNames ( compilerOptions ) ) || emitSkipped ;
337
338
}
338
339
}
339
340
else {
340
341
// targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service)
341
342
if ( shouldEmitToOwnFile ( targetSourceFile , compilerOptions ) ) {
342
- emitFile ( getEmitFileNames ( targetSourceFile , host ) , targetSourceFile ) ;
343
+ emitSkipped = emitFile ( getEmitFileNames ( targetSourceFile , host ) , targetSourceFile ) || emitSkipped ;
343
344
}
344
345
else if ( ! isDeclarationFile ( targetSourceFile ) &&
345
346
( compilerOptions . outFile || compilerOptions . out ) ) {
346
- emitFile ( getBundledEmitFileNames ( compilerOptions ) ) ;
347
+ emitSkipped = emitFile ( getBundledEmitFileNames ( compilerOptions ) ) || emitSkipped ;
347
348
}
348
349
}
349
350
350
351
// Sort and make the unique list of diagnostics
351
352
diagnostics = sortAndDeduplicateDiagnostics ( diagnostics ) ;
352
353
353
354
return {
354
- emitSkipped : false ,
355
+ emitSkipped,
355
356
diagnostics,
356
357
sourceMaps : sourceMapDataList
357
358
} ;
@@ -7597,13 +7598,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
7597
7598
7598
7599
function emitFile ( { jsFilePath, sourceMapFilePath, declarationFilePath} : { jsFilePath : string , sourceMapFilePath : string , declarationFilePath : string } , sourceFile ?: SourceFile ) {
7599
7600
// Make sure not to write js File and source map file if any of them cannot be written
7600
- if ( ! host . isEmitBlocked ( jsFilePath ) && ( ! sourceMapFilePath || ! host . isEmitBlocked ( sourceMapFilePath ) ) ) {
7601
+ let emitSkipped = host . isEmitBlocked ( jsFilePath ) || ( sourceMapFilePath && host . isEmitBlocked ( sourceMapFilePath ) ) ;
7602
+ if ( ! emitSkipped ) {
7601
7603
emitJavaScript ( jsFilePath , sourceMapFilePath , sourceFile ) ;
7602
7604
}
7603
7605
7604
7606
if ( compilerOptions . declaration ) {
7605
- writeDeclarationFile ( declarationFilePath , sourceFile , host , resolver , diagnostics ) ;
7607
+ emitSkipped = writeDeclarationFile ( declarationFilePath , sourceFile , host , resolver , diagnostics ) || emitSkipped ;
7606
7608
}
7609
+
7610
+ return emitSkipped ;
7607
7611
}
7608
7612
}
7609
7613
}
0 commit comments