Skip to content

Crash when a comment is included #23

@psiphi75

Description

@psiphi75

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions