@@ -2797,7 +2797,7 @@ namespace ts {
2797
2797
}
2798
2798
2799
2799
/** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */
2800
- function tryGetClassExtendingIdentifier ( node : Node ) : ClassLikeDeclaration | undefined {
2800
+ function tryGetClassByExtendingIdentifier ( node : Node ) : ClassLikeDeclaration | undefined {
2801
2801
return tryGetClassExtendingExpressionWithTypeArguments ( climbPastPropertyAccess ( node ) . parent ) ;
2802
2802
}
2803
2803
@@ -6506,7 +6506,7 @@ namespace ts {
6506
6506
}
6507
6507
else {
6508
6508
// If this class appears in `extends C`, then the extending class' "super" calls are references.
6509
- const classExtending = tryGetClassExtendingIdentifier ( referenceLocation ) ;
6509
+ const classExtending = tryGetClassByExtendingIdentifier ( referenceLocation ) ;
6510
6510
if ( classExtending && isClassLike ( classExtending ) && followAliasIfNecessary ( referenceSymbol , referenceLocation ) === searchSymbol ) {
6511
6511
addReferences ( superConstructorAccesses ( classExtending ) ) ;
6512
6512
}
@@ -6538,7 +6538,7 @@ namespace ts {
6538
6538
if ( decl && decl . kind === SyntaxKind . MethodDeclaration ) {
6539
6539
const body = ( < MethodDeclaration > decl ) . body ;
6540
6540
if ( body ) {
6541
- forEachDescendant ( body , SyntaxKind . ThisKeyword , thisKeyword => {
6541
+ forEachDescendantOfKind ( body , SyntaxKind . ThisKeyword , thisKeyword => {
6542
6542
if ( isNewExpressionTarget ( thisKeyword ) ) {
6543
6543
result . push ( thisKeyword ) ;
6544
6544
}
@@ -6563,7 +6563,7 @@ namespace ts {
6563
6563
Debug . assert ( decl . kind === SyntaxKind . Constructor ) ;
6564
6564
const body = ( < ConstructorDeclaration > decl ) . body ;
6565
6565
if ( body ) {
6566
- forEachDescendant ( body , SyntaxKind . SuperKeyword , node => {
6566
+ forEachDescendantOfKind ( body , SyntaxKind . SuperKeyword , node => {
6567
6567
if ( isCallExpressionTarget ( node ) ) {
6568
6568
result . push ( node ) ;
6569
6569
}
@@ -6956,7 +6956,7 @@ namespace ts {
6956
6956
function getRelatedSymbol ( searchSymbols : Symbol [ ] , referenceSymbol : Symbol , referenceLocation : Node , searchLocationIsConstructor : boolean ) : Symbol | undefined {
6957
6957
if ( contains ( searchSymbols , referenceSymbol ) ) {
6958
6958
// If we are searching for constructor uses, they must be 'new' expressions.
6959
- return ! ( searchLocationIsConstructor && ! isNewExpressionTarget ( referenceLocation ) ) && referenceSymbol ;
6959
+ return ( ! searchLocationIsConstructor || isNewExpressionTarget ( referenceLocation ) ) && referenceSymbol ;
6960
6960
}
6961
6961
6962
6962
// If the reference symbol is an alias, check if what it is aliasing is one of the search
@@ -8487,12 +8487,12 @@ namespace ts {
8487
8487
} ;
8488
8488
}
8489
8489
8490
- function forEachDescendant ( node : Node , kind : SyntaxKind , action : ( node : Node ) => void ) {
8490
+ function forEachDescendantOfKind ( node : Node , kind : SyntaxKind , action : ( node : Node ) => void ) {
8491
8491
forEachChild ( node , child => {
8492
8492
if ( child . kind === kind ) {
8493
8493
action ( child ) ;
8494
8494
}
8495
- forEachDescendant ( child , kind , action ) ;
8495
+ forEachDescendantOfKind ( child , kind , action ) ;
8496
8496
} ) ;
8497
8497
}
8498
8498
0 commit comments