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

Function emitSourceFile

test/fixtures/snapshot/typescript.js:113461–113474  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

113459 // Top-level nodes
113460 //
113461 function emitSourceFile(node) {
113462 writeLine();
113463 var statements = node.statements;
113464 // Emit detached comment if there are no prologue directives or if the first node is synthesized.
113465 // The synthesized node will have no leading comment so some comments may be missed.
113466 var shouldEmitDetachedComment = statements.length === 0 ||
113467 !ts.isPrologueDirective(statements[0]) ||
113468 ts.nodeIsSynthesized(statements[0]);
113469 if (shouldEmitDetachedComment) {
113470 emitBodyWithDetachedComments(node, statements, emitSourceFileWorker);
113471 return;
113472 }
113473 emitSourceFileWorker(node);
113474 }
113475 function emitSyntheticTripleSlashReferencesIfNeeded(node) {
113476 emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []);
113477 for (var _a = 0, _b = node.prepends; _a < _b.length; _a++) {

Callers 1

Calls 3

emitSourceFileWorkerFunction · 0.85
writeLineFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…