MCPcopy Create free account
hub / github.com/nodejs/node / getNodes

Function getNodes

test/fixtures/snapshot/typescript.js:155342–155351  ·  view source on GitHub ↗
(sourceFile, pos)

Source from the content-addressed store, hash-verified

155340 changes.delete(sourceFile, superCall);
155341 }
155342 function getNodes(sourceFile, pos) {
155343 var token = ts.getTokenAtPosition(sourceFile, pos);
155344 if (token.kind !== 108 /* SyntaxKind.ThisKeyword */)
155345 return undefined;
155346 var constructor = ts.getContainingFunction(token);
155347 var superCall = findSuperCall(constructor.body);
155348 // figure out if the `this` access is actually inside the supercall
155349 // i.e. super(this.a), since in that case we won't suggest a fix
155350 return superCall && !superCall.expression.arguments.some(function (arg) { return ts.isPropertyAccessExpression(arg) && arg.expression === token; }) ? { constructor: constructor, superCall: superCall } : undefined;
155351 }
155352 function findSuperCall(n) {
155353 return ts.isExpressionStatement(n) && ts.isSuperCall(n.expression)
155354 ? n

Callers 2

useParentFunction · 0.85
typescript.jsFile · 0.85

Calls 4

findSuperCallFunction · 0.85
getReturnTypeFunction · 0.85
someMethod · 0.80
firstMethod · 0.45

Tested by

no test coverage detected