@@ -300,8 +300,8 @@ namespace ts {
300
300
return getTokenPosOfNode ( node . jsDocComments [ 0 ] ) ;
301
301
}
302
302
303
- // For a syntax list, it is possible that one of its children has JSDocComment nodes, while
304
- // the syntax list itself considers them as normal trivia. Therefore if we simply skip
303
+ // For a syntax list, it is possible that one of its children has JSDocComment nodes, while
304
+ // the syntax list itself considers them as normal trivia. Therefore if we simply skip
305
305
// trivia for the list, we may have skipped the JSDocComment as well. So we should process its
306
306
// first child to determine the actual position of its first token.
307
307
if ( node . kind === SyntaxKind . SyntaxList && ( < SyntaxList > node ) . _children . length > 0 ) {
@@ -2485,6 +2485,15 @@ namespace ts {
2485
2485
declarationFilePath : string ;
2486
2486
}
2487
2487
2488
+ /**
2489
+ * Gets the source files that are expected to have an emit output.
2490
+ *
2491
+ * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support
2492
+ * transformations.
2493
+ *
2494
+ * @param host An EmitHost.
2495
+ * @param targetSourceFile An optional target source file to emit.
2496
+ */
2488
2497
export function getSourceFilesToEmit ( host : EmitHost , targetSourceFile ?: SourceFile ) {
2489
2498
const options = host . getCompilerOptions ( ) ;
2490
2499
if ( options . outFile || options . out ) {
@@ -2508,7 +2517,18 @@ namespace ts {
2508
2517
return ! isDeclarationFile ( sourceFile ) && ! isExternalModule ( sourceFile ) ;
2509
2518
}
2510
2519
2511
- export function forEachEmitFile ( host : EmitHost , sourceFiles : SourceFile [ ] ,
2520
+ /**
2521
+ * Iterates over each source file to emit. The source files are expected to have been
2522
+ * transformed for use by the pretty printer.
2523
+ *
2524
+ * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support
2525
+ * transformations.
2526
+ *
2527
+ * @param host An EmitHost.
2528
+ * @param sourceFiles The transformed source files to emit.
2529
+ * @param action The action to execute.
2530
+ */
2531
+ export function forEachTransformedEmitFile ( host : EmitHost , sourceFiles : SourceFile [ ] ,
2512
2532
action : ( jsFilePath : string , sourceMapFilePath : string , declarationFilePath : string , sourceFiles : SourceFile [ ] , isBundledEmit : boolean ) => void ) {
2513
2533
const options = host . getCompilerOptions ( ) ;
2514
2534
// Emit on each source file
@@ -2559,6 +2579,15 @@ namespace ts {
2559
2579
return options . sourceMap ? jsFilePath + ".map" : undefined ;
2560
2580
}
2561
2581
2582
+ /**
2583
+ * Iterates over the source files that are expected to have an emit output. This function
2584
+ * is used by the legacy emitter and the declaration emitter and should not be used by
2585
+ * the tree transforming emitter.
2586
+ *
2587
+ * @param host An EmitHost.
2588
+ * @param action The action to execute.
2589
+ * @param targetSourceFile An optional target source file to emit.
2590
+ */
2562
2591
export function forEachExpectedEmitFile ( host : EmitHost ,
2563
2592
action : ( emitFileNames : EmitFileNames , sourceFiles : SourceFile [ ] , isBundledEmit : boolean ) => void ,
2564
2593
targetSourceFile ?: SourceFile ) {
0 commit comments