MCPcopy Create free account
hub / github.com/nodejs/node / emitTrailingCommentsOfNode

Function emitTrailingCommentsOfNode

test/fixtures/snapshot/typescript.js:114759–114775  ·  view source on GitHub ↗
(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd)

Source from the content-addressed store, hash-verified

114757 exitComment();
114758 }
114759 function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) {
114760 enterComment();
114761 var skipTrailingComments = end < 0 || (emitFlags & 1024 /* EmitFlags.NoTrailingComments */) !== 0 || node.kind === 11 /* SyntaxKind.JsxText */;
114762 ts.forEach(ts.getSyntheticTrailingComments(node), emitTrailingSynthesizedComment);
114763 if ((pos > 0 || end > 0) && pos !== end) {
114764 // Restore previous container state.
114765 containerPos = savedContainerPos;
114766 containerEnd = savedContainerEnd;
114767 declarationListContainerEnd = savedDeclarationListContainerEnd;
114768 // Emit trailing comments if the position is not synthesized and the node
114769 // has not opted out from emitting leading comments and is an emitted node.
114770 if (!skipTrailingComments && node.kind !== 349 /* SyntaxKind.NotEmittedStatement */) {
114771 emitTrailingComments(end);
114772 }
114773 }
114774 exitComment();
114775 }
114776 function emitLeadingSynthesizedComment(comment) {
114777 if (comment.hasLeadingNewline || comment.kind === 2 /* SyntaxKind.SingleLineCommentTrivia */) {
114778 writer.writeLine();

Callers 1

emitCommentsAfterNodeFunction · 0.85

Calls 2

emitTrailingCommentsFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected