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

Function isConstantReference

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

Source from the content-addressed store, hash-verified

70286 }
70287 }
70288 function isConstantReference(node) {
70289 switch (node.kind) {
70290 case 79 /* SyntaxKind.Identifier */: {
70291 var symbol = getResolvedSymbol(node);
70292 return isConstVariable(symbol) || ts.isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
70293 }
70294 case 206 /* SyntaxKind.PropertyAccessExpression */:
70295 case 207 /* SyntaxKind.ElementAccessExpression */:
70296 // The resolvedSymbol property is initialized by checkPropertyAccess or checkElementAccess before we get here.
70297 return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
70298 }
70299 return false;
70300 }
70301 function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, flowNode) {
70302 if (initialType === void 0) { initialType = declaredType; }
70303 if (flowNode === void 0) { flowNode = reference.flowNode; }

Callers 1

narrowTypeFunction · 0.85

Calls 5

getResolvedSymbolFunction · 0.85
isConstVariableFunction · 0.85
isSymbolAssignedFunction · 0.85
isReadonlySymbolFunction · 0.85
getNodeLinksFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…