flow-jsdoc icon indicating copy to clipboard operation
flow-jsdoc copied to clipboard

Crash when a comment is included

Open psiphi75 opened this issue 7 years ago • 0 comments

The following code causes a crash:

function a() {
  return '';   // a
}

export { 
  a
};

Where as if you remove the // a comment it does not.

The crash error is:

/home/user/node_modules/flow-jsdoc/index.js:210
            if (declaration.type === 'VariableDeclaration') {
                            ^

TypeError: Cannot read property 'type' of null
    at getCommentedFunctionNode (/home/user/node_modules/flow-jsdoc/index.js:210:29)
    at decorateFunctions (/home/user/node_modules/flow-jsdoc/index.js:291:20)
    at /home/user/node_modules/flow-jsdoc/index.js:408:9
    at walk (/home/user/node_modules/flow-jsdoc/lib/falafel.js:62:9)
    at /home/user/node_modules/flow-jsdoc/lib/falafel.js:53:25
    at Array.forEach (<anonymous>)
    at forEach (/home/user/node_modules/flow-jsdoc/lib/falafel.js:10:31)
    at /home/user/node_modules/flow-jsdoc/lib/falafel.js:51:17
    at Array.forEach (<anonymous>)
    at forEach (/home/user/node_modules/flow-jsdoc/lib/falafel.js:10:31)

psiphi75 avatar May 10 '18 00:05 psiphi75