Skip to content

Commit d9fdc7a

Browse files
committed
fix(require-jsdoc): avoid error for unnamed default functions and classes (export default ...), though does not yet handle
1 parent c314056 commit d9fdc7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/exportParser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ createSymbol = function (node, globals, value, scope, isGlobal) {
123123
let symbol;
124124
switch (node.type) {
125125
case 'ClassDeclaration': {
126-
if (node.id.type === 'Identifier') {
126+
if (node.id && node.id.type === 'Identifier') {
127127
return createSymbol(node.id, globals, node, globals);
128128
}
129129
break;
@@ -155,7 +155,7 @@ createSymbol = function (node, globals, value, scope, isGlobal) {
155155
debug('MemberExpression: Missing symbol: %s', node.property.name);
156156
break;
157157
} case 'FunctionDeclaration': {
158-
if (node.id.type === 'Identifier') {
158+
if (node.id && node.id.type === 'Identifier') {
159159
return createSymbol(node.id, globals, node, globals);
160160
}
161161
break;

0 commit comments

Comments
 (0)