MCPcopy Index your code
hub / github.com/nodejs/node / emitNextAffectedFile

Function emitNextAffectedFile

test/fixtures/snapshot/typescript.js:120829–120864  ·  view source on GitHub ↗

* Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host * in that order would be used to write the f

(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)

Source from the content-addressed store, hash-verified

120827 * in that order would be used to write the files
120828 */
120829 function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
120830 var affected = getNextAffectedFile(state, cancellationToken, computeHash, host);
120831 var emitKind = 1 /* BuilderFileEmit.Full */;
120832 var isPendingEmitFile = false;
120833 if (!affected) {
120834 if (!ts.outFile(state.compilerOptions)) {
120835 var pendingAffectedFile = getNextAffectedFilePendingEmit(state);
120836 if (!pendingAffectedFile) {
120837 if (!state.buildInfoEmitPending) {
120838 return undefined;
120839 }
120840 var affected_1 = ts.Debug.checkDefined(state.program);
120841 return toAffectedFileEmitResult(state,
120842 // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
120843 // Otherwise just affected file
120844 affected_1.emitBuildInfo(writeFile || ts.maybeBind(host, host.writeFile), cancellationToken), affected_1, 1 /* BuilderFileEmit.Full */,
120845 /*isPendingEmitFile*/ false,
120846 /*isBuildInfoEmit*/ true);
120847 }
120848 (affected = pendingAffectedFile.affectedFile, emitKind = pendingAffectedFile.emitKind);
120849 isPendingEmitFile = true;
120850 }
120851 else {
120852 var program = ts.Debug.checkDefined(state.program);
120853 if (state.programEmitComplete)
120854 return undefined;
120855 affected = program;
120856 }
120857 }
120858 return toAffectedFileEmitResult(state,
120859 // When whole program is affected, do emit only once (eg when --out or --outFile is specified)
120860 // Otherwise just affected file
120861 ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, affected !== state.program && ts.getEmitDeclarations(state.compilerOptions) && !customTransformers ?
120862 getWriteFileUpdatingSignatureCallback(writeFile) :
120863 writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0 /* BuilderFileEmit.DtsOnly */, customTransformers), affected, emitKind, isPendingEmitFile);
120864 }
120865 function getWriteFileUpdatingSignatureCallback(writeFile) {
120866 return function (fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
120867 var _a;

Callers 1

emitFunction · 0.85

Calls 5

getNextAffectedFileFunction · 0.85
toAffectedFileEmitResultFunction · 0.85
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…