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

Function maybeEmitExpression

test/fixtures/snapshot/typescript.js:112401–112421  ·  view source on GitHub ↗
(next, parent, side)

Source from the content-addressed store, hash-verified

112399 }
112400 }
112401 function maybeEmitExpression(next, parent, side) {
112402 var parenthesizerRule = side === "left" ?
112403 parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent.operatorToken.kind) :
112404 parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent.operatorToken.kind);
112405 var pipelinePhase = getPipelinePhase(0 /* PipelinePhase.Notification */, 1 /* EmitHint.Expression */, next);
112406 if (pipelinePhase === pipelineEmitWithSubstitution) {
112407 ts.Debug.assertIsDefined(lastSubstitution);
112408 next = parenthesizerRule(ts.cast(lastSubstitution, ts.isExpression));
112409 pipelinePhase = getNextPipelinePhase(1 /* PipelinePhase.Substitution */, 1 /* EmitHint.Expression */, next);
112410 lastSubstitution = undefined;
112411 }
112412 if (pipelinePhase === pipelineEmitWithComments ||
112413 pipelinePhase === pipelineEmitWithSourceMaps ||
112414 pipelinePhase === pipelineEmitWithHint) {
112415 if (ts.isBinaryExpression(next)) {
112416 return next;
112417 }
112418 }
112419 currentParenthesizerRule = parenthesizerRule;
112420 pipelinePhase(1 /* EmitHint.Expression */, next);
112421 }
112422 }
112423 function emitConditionalExpression(node) {
112424 var linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken);

Callers 2

onLeftFunction · 0.85
onRightFunction · 0.85

Calls 2

getPipelinePhaseFunction · 0.85
getNextPipelinePhaseFunction · 0.85

Tested by

no test coverage detected