Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses.
(referenceLocation, sourceFile, search, state)
| 138333 | } |
| 138334 | /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ |
| 138335 | function addConstructorReferences(referenceLocation, sourceFile, search, state) { |
| 138336 | if (ts.isNewExpressionTarget(referenceLocation)) { |
| 138337 | addReference(referenceLocation, search.symbol, state); |
| 138338 | } |
| 138339 | var pusher = function () { return state.referenceAdder(search.symbol); }; |
| 138340 | if (ts.isClassLike(referenceLocation.parent)) { |
| 138341 | ts.Debug.assert(referenceLocation.kind === 88 /* SyntaxKind.DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); |
| 138342 | // This is the class declaration containing the constructor. |
| 138343 | findOwnConstructorReferences(search.symbol, sourceFile, pusher()); |
| 138344 | } |
| 138345 | else { |
| 138346 | // If this class appears in `extends C`, then the extending class' "super" calls are references. |
| 138347 | var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); |
| 138348 | if (classExtending) { |
| 138349 | findSuperConstructorAccesses(classExtending, pusher()); |
| 138350 | findInheritedConstructorReferences(classExtending, state); |
| 138351 | } |
| 138352 | } |
| 138353 | } |
| 138354 | function addClassStaticThisReferences(referenceLocation, search, state) { |
| 138355 | addReference(referenceLocation, search.symbol, state); |
| 138356 | var classLike = referenceLocation.parent; |
no test coverage detected