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

Function checkForStaticContext

test/fixtures/snapshot/typescript.js:160286–160309  ·  view source on GitHub ↗
(nodeToCheck, containingClass)

Source from the content-addressed store, hash-verified

160284 return undefined;
160285 }
160286 function checkForStaticContext(nodeToCheck, containingClass) {
160287 var current = nodeToCheck;
160288 while (current !== containingClass) {
160289 if (current.kind === 167 /* SyntaxKind.PropertyDeclaration */) {
160290 if (ts.isStatic(current)) {
160291 rangeFacts |= RangeFacts.InStaticRegion;
160292 }
160293 break;
160294 }
160295 else if (current.kind === 164 /* SyntaxKind.Parameter */) {
160296 var ctorOrMethod = ts.getContainingFunction(current);
160297 if (ctorOrMethod.kind === 171 /* SyntaxKind.Constructor */) {
160298 rangeFacts |= RangeFacts.InStaticRegion;
160299 }
160300 break;
160301 }
160302 else if (current.kind === 169 /* SyntaxKind.MethodDeclaration */) {
160303 if (ts.isStatic(current)) {
160304 rangeFacts |= RangeFacts.InStaticRegion;
160305 }
160306 }
160307 current = current.parent;
160308 }
160309 }
160310 // Verifies whether we can actually extract this node or not.
160311 function checkNode(nodeToCheck) {
160312 var PermittedJumps;

Callers 1

checkNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…