(sourceFile, pos)
| 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 |
no test coverage detected