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

Function emitCaseOrDefaultClauseRest

test/fixtures/snapshot/typescript.js:113228–113246  ·  view source on GitHub ↗
(parentNode, statements, colonPos)

Source from the content-addressed store, hash-verified

113226 emitCaseOrDefaultClauseRest(node, node.statements, pos);
113227 }
113228 function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) {
113229 var emitAsSingleStatement = statements.length === 1 &&
113230 (
113231 // treat synthesized nodes as located on the same line for emit purposes
113232 !currentSourceFile ||
113233 ts.nodeIsSynthesized(parentNode) ||
113234 ts.nodeIsSynthesized(statements[0]) ||
113235 ts.rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile));
113236 var format = 163969 /* ListFormat.CaseOrDefaultClauseStatements */;
113237 if (emitAsSingleStatement) {
113238 writeToken(58 /* SyntaxKind.ColonToken */, colonPos, writePunctuation, parentNode);
113239 writeSpace();
113240 format &= ~(1 /* ListFormat.MultiLine */ | 128 /* ListFormat.Indented */);
113241 }
113242 else {
113243 emitTokenWithComment(58 /* SyntaxKind.ColonToken */, colonPos, writePunctuation, parentNode);
113244 }
113245 emitList(parentNode, statements, format);
113246 }
113247 function emitHeritageClause(node) {
113248 writeSpace();
113249 writeTokenText(node.token, writeKeyword);

Callers 2

emitCaseClauseFunction · 0.85
emitDefaultClauseFunction · 0.85

Calls 4

writeTokenFunction · 0.85
writeSpaceFunction · 0.85
emitTokenWithCommentFunction · 0.85
emitListFunction · 0.85

Tested by

no test coverage detected