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

Function isTopLevelLogicalExpression

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

Source from the content-addressed store, hash-verified

45518 return ts.isBinaryExpression(node) && ts.isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind);
45519 }
45520 function isTopLevelLogicalExpression(node) {
45521 while (ts.isParenthesizedExpression(node.parent) ||
45522 ts.isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* SyntaxKind.ExclamationToken */) {
45523 node = node.parent;
45524 }
45525 return !isStatementCondition(node) &&
45526 !isLogicalExpression(node.parent) &&
45527 !(ts.isOptionalChain(node.parent) && node.parent.expression === node);
45528 }
45529 function doWithConditionalBranches(action, value, trueTarget, falseTarget) {
45530 var savedTrueTarget = currentTrueTarget;
45531 var savedFalseTarget = currentFalseTarget;

Callers 2

onEnterFunction · 0.85
bindOptionalChainFlowFunction · 0.85

Calls 2

isStatementConditionFunction · 0.85
isLogicalExpressionFunction · 0.85

Tested by

no test coverage detected