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

Function isSymbolUsedInBinaryExpressionChain

test/fixtures/snapshot/typescript.js:82778–82795  ·  view source on GitHub ↗
(node, testedSymbol)

Source from the content-addressed store, hash-verified

82776 });
82777 }
82778 function isSymbolUsedInBinaryExpressionChain(node, testedSymbol) {
82779 while (ts.isBinaryExpression(node) && node.operatorToken.kind === 55 /* SyntaxKind.AmpersandAmpersandToken */) {
82780 var isUsed = ts.forEachChild(node.right, function visit(child) {
82781 if (ts.isIdentifier(child)) {
82782 var symbol = getSymbolAtLocation(child);
82783 if (symbol && symbol === testedSymbol) {
82784 return true;
82785 }
82786 }
82787 return ts.forEachChild(child, visit);
82788 });
82789 if (isUsed) {
82790 return true;
82791 }
82792 node = node.parent;
82793 }
82794 return false;
82795 }
82796 function checkDoStatement(node) {
82797 // Grammar checking
82798 checkGrammarStatementInAmbientContext(node);

Callers 1

helperFunction · 0.85

Calls 2

getSymbolAtLocationFunction · 0.85
forEachChildMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…