@@ -904,6 +904,7 @@ namespace ts {
904
904
function visit ( node : Node ) : void {
905
905
switch ( node . kind ) {
906
906
case SyntaxKind . FunctionDeclaration :
907
+ case SyntaxKind . FunctionExpression :
907
908
case SyntaxKind . MethodDeclaration :
908
909
case SyntaxKind . MethodSignature :
909
910
const functionDeclaration = < FunctionLikeDeclaration > node ;
@@ -930,6 +931,7 @@ namespace ts {
930
931
break ;
931
932
932
933
case SyntaxKind . ClassDeclaration :
934
+ case SyntaxKind . ClassExpression :
933
935
case SyntaxKind . InterfaceDeclaration :
934
936
case SyntaxKind . TypeAliasDeclaration :
935
937
case SyntaxKind . EnumDeclaration :
@@ -967,11 +969,15 @@ namespace ts {
967
969
}
968
970
// fall through
969
971
case SyntaxKind . VariableDeclaration :
970
- case SyntaxKind . BindingElement :
971
- if ( isBindingPattern ( ( < VariableDeclaration > node ) . name ) ) {
972
- forEachChild ( ( < VariableDeclaration > node ) . name , visit ) ;
972
+ case SyntaxKind . BindingElement : {
973
+ const decl = < VariableDeclaration > node ;
974
+ if ( isBindingPattern ( decl . name ) ) {
975
+ forEachChild ( decl . name , visit ) ;
973
976
break ;
974
977
}
978
+ if ( decl . initializer )
979
+ visit ( decl . initializer ) ;
980
+ }
975
981
case SyntaxKind . EnumMember :
976
982
case SyntaxKind . PropertyDeclaration :
977
983
case SyntaxKind . PropertySignature :
@@ -2770,7 +2776,9 @@ namespace ts {
2770
2776
/* @internal */ export function getNodeKind ( node : Node ) : string {
2771
2777
switch ( node . kind ) {
2772
2778
case SyntaxKind . ModuleDeclaration : return ScriptElementKind . moduleElement ;
2773
- case SyntaxKind . ClassDeclaration : return ScriptElementKind . classElement ;
2779
+ case SyntaxKind . ClassDeclaration :
2780
+ case SyntaxKind . ClassExpression :
2781
+ return ScriptElementKind . classElement ;
2774
2782
case SyntaxKind . InterfaceDeclaration : return ScriptElementKind . interfaceElement ;
2775
2783
case SyntaxKind . TypeAliasDeclaration : return ScriptElementKind . typeElement ;
2776
2784
case SyntaxKind . EnumDeclaration : return ScriptElementKind . enumElement ;
@@ -2780,7 +2788,9 @@ namespace ts {
2780
2788
: isLet ( node )
2781
2789
? ScriptElementKind . letElement
2782
2790
: ScriptElementKind . variableElement ;
2783
- case SyntaxKind . FunctionDeclaration : return ScriptElementKind . functionElement ;
2791
+ case SyntaxKind . FunctionDeclaration :
2792
+ case SyntaxKind . FunctionExpression :
2793
+ return ScriptElementKind . functionElement ;
2784
2794
case SyntaxKind . GetAccessor : return ScriptElementKind . memberGetAccessorElement ;
2785
2795
case SyntaxKind . SetAccessor : return ScriptElementKind . memberSetAccessorElement ;
2786
2796
case SyntaxKind . MethodDeclaration :
0 commit comments