File tree Expand file tree Collapse file tree 1 file changed +4
-30
lines changed Expand file tree Collapse file tree 1 file changed +4
-30
lines changed Original file line number Diff line number Diff line change @@ -1681,36 +1681,10 @@ namespace ts.FindAllReferences.Core {
1681
1681
}
1682
1682
1683
1683
function isImplementation ( node : Node ) : boolean {
1684
- if ( ! node ) {
1685
- return false ;
1686
- }
1687
- else if ( isVariableLike ( node ) && hasInitializer ( node ) ) {
1688
- return true ;
1689
- }
1690
- else if ( node . kind === SyntaxKind . VariableDeclaration ) {
1691
- const parentStatement = getParentStatementOfVariableDeclaration ( < VariableDeclaration > node ) ;
1692
- return parentStatement && hasModifier ( parentStatement , ModifierFlags . Ambient ) ;
1693
- }
1694
- else if ( isFunctionLike ( node ) ) {
1695
- return ! ! ( node as FunctionLikeDeclaration ) . body || hasModifier ( node , ModifierFlags . Ambient ) ;
1696
- }
1697
- else {
1698
- switch ( node . kind ) {
1699
- case SyntaxKind . ClassDeclaration :
1700
- case SyntaxKind . ClassExpression :
1701
- case SyntaxKind . EnumDeclaration :
1702
- case SyntaxKind . ModuleDeclaration :
1703
- return true ;
1704
- }
1705
- }
1706
- return false ;
1707
- }
1708
-
1709
- function getParentStatementOfVariableDeclaration ( node : VariableDeclaration ) : VariableStatement {
1710
- if ( node . parent && node . parent . parent && node . parent . parent . kind === SyntaxKind . VariableStatement ) {
1711
- Debug . assert ( node . parent . kind === SyntaxKind . VariableDeclarationList ) ;
1712
- return node . parent . parent ;
1713
- }
1684
+ return ! ! ( node . flags & NodeFlags . Ambient )
1685
+ || ( isVariableLike ( node ) ? hasInitializer ( node )
1686
+ : isFunctionLikeDeclaration ( node ) ? ! ! node . body
1687
+ : isClassLike ( node ) || isModuleOrEnumDeclaration ( node ) ) ;
1714
1688
}
1715
1689
1716
1690
export function getReferenceEntriesForShorthandPropertyAssignment ( node : Node , checker : TypeChecker , addReference : ( node : Node ) => void ) : void {
You can’t perform that action at this time.
0 commit comments