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

Function isForInVariableForNumericPropertyNames

test/fixtures/snapshot/typescript.js:75200–75220  ·  view source on GitHub ↗

* Return true if given node is an expression consisting of an identifier (possibly parenthesized) * that references a for-in variable for an object with numeric property names.

(expr)

Source from the content-addressed store, hash-verified

75198 * that references a for-in variable for an object with numeric property names.
75199 */
75200 function isForInVariableForNumericPropertyNames(expr) {
75201 var e = ts.skipParentheses(expr);
75202 if (e.kind === 79 /* SyntaxKind.Identifier */) {
75203 var symbol = getResolvedSymbol(e);
75204 if (symbol.flags & 3 /* SymbolFlags.Variable */) {
75205 var child = expr;
75206 var node = expr.parent;
75207 while (node) {
75208 if (node.kind === 243 /* SyntaxKind.ForInStatement */ &&
75209 child === node.statement &&
75210 getForInVariableSymbol(node) === symbol &&
75211 hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
75212 return true;
75213 }
75214 child = node;
75215 node = node.parent;
75216 }
75217 }
75218 }
75219 return false;
75220 }
75221 function checkIndexedAccess(node, checkMode) {
75222 return node.flags & 32 /* NodeFlags.OptionalChain */ ? checkElementAccessChain(node, checkMode) :
75223 checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode);

Callers 1

Calls 4

getResolvedSymbolFunction · 0.85
getForInVariableSymbolFunction · 0.85
hasNumericPropertyNamesFunction · 0.85
getTypeOfExpressionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…