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

Function emitPropertyAssignment

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

Source from the content-addressed store, hash-verified

113265 // Property assignments
113266 //
113267 function emitPropertyAssignment(node) {
113268 emit(node.name);
113269 writePunctuation(":");
113270 writeSpace();
113271 // This is to ensure that we emit comment in the following case:
113272 // For example:
113273 // obj = {
113274 // id: /*comment1*/ ()=>void
113275 // }
113276 // "comment1" is not considered to be leading comment for node.initializer
113277 // but rather a trailing comment on the previous node.
113278 var initializer = node.initializer;
113279 if ((ts.getEmitFlags(initializer) & 512 /* EmitFlags.NoLeadingComments */) === 0) {
113280 var commentRange = ts.getCommentRange(initializer);
113281 emitTrailingCommentsOfPosition(commentRange.pos);
113282 }
113283 emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma);
113284 }
113285 function emitShorthandPropertyAssignment(node) {
113286 emit(node.name);
113287 if (node.objectAssignmentInitializer) {

Callers 1

Calls 5

writePunctuationFunction · 0.85
writeSpaceFunction · 0.85
emitExpressionFunction · 0.85
emitFunction · 0.70

Tested by

no test coverage detected