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

Function emitBodyWithDetachedComments

test/fixtures/snapshot/typescript.js:114807–114833  ·  view source on GitHub ↗
(node, detachedRange, emitCallback)

Source from the content-addressed store, hash-verified

114805 : "//".concat(comment.text);
114806 }
114807 function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
114808 enterComment();
114809 var pos = detachedRange.pos, end = detachedRange.end;
114810 var emitFlags = ts.getEmitFlags(node);
114811 var skipLeadingComments = pos < 0 || (emitFlags & 512 /* EmitFlags.NoLeadingComments */) !== 0;
114812 var skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 1024 /* EmitFlags.NoTrailingComments */) !== 0;
114813 if (!skipLeadingComments) {
114814 emitDetachedCommentsAndUpdateCommentsInfo(detachedRange);
114815 }
114816 exitComment();
114817 if (emitFlags & 2048 /* EmitFlags.NoNestedComments */ && !commentsDisabled) {
114818 commentsDisabled = true;
114819 emitCallback(node);
114820 commentsDisabled = false;
114821 }
114822 else {
114823 emitCallback(node);
114824 }
114825 enterComment();
114826 if (!skipTrailingComments) {
114827 emitLeadingComments(detachedRange.end, /*isEmittedNode*/ true);
114828 if (hasWrittenComment && !writer.isAtStartOfLine()) {
114829 writer.writeLine();
114830 }
114831 }
114832 exitComment();
114833 }
114834 function originalNodesHaveSameParent(nodeA, nodeB) {
114835 nodeA = ts.getOriginalNode(nodeA);
114836 // For performance, do not call `getOriginalNode` for `nodeB` if `nodeA` doesn't even

Callers 2

emitBlockFunctionBodyFunction · 0.85
emitSourceFileFunction · 0.85

Tested by

no test coverage detected