@@ -2797,7 +2797,7 @@ namespace ts {
27972797 }
27982798
27992799 /** 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 {
28012801 return tryGetClassExtendingExpressionWithTypeArguments ( climbPastPropertyAccess ( node ) . parent ) ;
28022802 }
28032803
@@ -6506,7 +6506,7 @@ namespace ts {
65066506 }
65076507 else {
65086508 // 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 ) ;
65106510 if ( classExtending && isClassLike ( classExtending ) && followAliasIfNecessary ( referenceSymbol , referenceLocation ) === searchSymbol ) {
65116511 addReferences ( superConstructorAccesses ( classExtending ) ) ;
65126512 }
@@ -6538,7 +6538,7 @@ namespace ts {
65386538 if ( decl && decl . kind === SyntaxKind . MethodDeclaration ) {
65396539 const body = ( < MethodDeclaration > decl ) . body ;
65406540 if ( body ) {
6541- forEachDescendant ( body , SyntaxKind . ThisKeyword , thisKeyword => {
6541+ forEachDescendantOfKind ( body , SyntaxKind . ThisKeyword , thisKeyword => {
65426542 if ( isNewExpressionTarget ( thisKeyword ) ) {
65436543 result . push ( thisKeyword ) ;
65446544 }
@@ -6563,7 +6563,7 @@ namespace ts {
65636563 Debug . assert ( decl . kind === SyntaxKind . Constructor ) ;
65646564 const body = ( < ConstructorDeclaration > decl ) . body ;
65656565 if ( body ) {
6566- forEachDescendant ( body , SyntaxKind . SuperKeyword , node => {
6566+ forEachDescendantOfKind ( body , SyntaxKind . SuperKeyword , node => {
65676567 if ( isCallExpressionTarget ( node ) ) {
65686568 result . push ( node ) ;
65696569 }
@@ -6956,7 +6956,7 @@ namespace ts {
69566956 function getRelatedSymbol ( searchSymbols : Symbol [ ] , referenceSymbol : Symbol , referenceLocation : Node , searchLocationIsConstructor : boolean ) : Symbol | undefined {
69576957 if ( contains ( searchSymbols , referenceSymbol ) ) {
69586958 // If we are searching for constructor uses, they must be 'new' expressions.
6959- return ! ( searchLocationIsConstructor && ! isNewExpressionTarget ( referenceLocation ) ) && referenceSymbol ;
6959+ return ( ! searchLocationIsConstructor || isNewExpressionTarget ( referenceLocation ) ) && referenceSymbol ;
69606960 }
69616961
69626962 // If the reference symbol is an alias, check if what it is aliasing is one of the search
@@ -8487,12 +8487,12 @@ namespace ts {
84878487 } ;
84888488 }
84898489
8490- function forEachDescendant ( node : Node , kind : SyntaxKind , action : ( node : Node ) => void ) {
8490+ function forEachDescendantOfKind ( node : Node , kind : SyntaxKind , action : ( node : Node ) => void ) {
84918491 forEachChild ( node , child => {
84928492 if ( child . kind === kind ) {
84938493 action ( child ) ;
84948494 }
8495- forEachDescendant ( child , kind , action ) ;
8495+ forEachDescendantOfKind ( child , kind , action ) ;
84968496 } ) ;
84978497 }
84988498
0 commit comments