@@ -67,7 +67,7 @@ const getSymbol = function (node, globals, scope, opt) {
67
67
debug ( 'MemberExpression: Missing property ' + node . property . name ) ;
68
68
69
69
return null ;
70
- } case 'FunctionExpression' : case 'FunctionDeclaration' : case 'ArrowFunctionExpression' : {
70
+ } case 'ClassDeclaration' : case ' FunctionExpression' : case 'FunctionDeclaration' : case 'ArrowFunctionExpression' : {
71
71
const val = createNode ( ) ;
72
72
val . props . prototype = createNode ( ) ;
73
73
val . props . prototype . type = 'object' ;
@@ -115,7 +115,12 @@ createSymbol = function (node, globals, value, scope) {
115
115
const block = scope || globals ;
116
116
let symbol ;
117
117
switch ( node . type ) {
118
- case 'Identifier' : {
118
+ case 'ClassDeclaration' : {
119
+ if ( node . id . type === 'Identifier' ) {
120
+ return createSymbol ( node . id , globals , node , globals ) ;
121
+ }
122
+ break ;
123
+ } case 'Identifier' : {
119
124
if ( value ) {
120
125
const valueSymbol = getSymbol ( value , globals , block ) ;
121
126
if ( valueSymbol ) {
@@ -204,7 +209,9 @@ const mapVariables = function (node, globals) {
204
209
break ;
205
210
} case 'ExportDefaultDeclaration' : {
206
211
const symbol = createSymbol ( node . declaration , globals , node . declaration ) ;
207
- symbol . exported = true ;
212
+ if ( symbol ) {
213
+ symbol . exported = true ;
214
+ }
208
215
break ;
209
216
} case 'ExportNamedDeclaration' : {
210
217
if ( node . declaration ) {
@@ -217,7 +224,9 @@ const mapVariables = function (node, globals) {
217
224
break ;
218
225
} case 'ExportSpecifier' : {
219
226
const symbol = getSymbol ( node . local , globals , globals ) ;
220
- symbol . exported = true ;
227
+ if ( symbol ) {
228
+ symbol . exported = true ;
229
+ }
221
230
break ;
222
231
} case 'ClassDeclaration' : {
223
232
createSymbol ( node . id , globals , node . body , globals ) ;
0 commit comments