When @webdoc/parser parses a method that has no parameters, it crashes with the following error:
(node:4199) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
at mangled (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/model/lib/doc.js:296:50)
at discoverMembers (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/transformer/mod-discover-members.js:53:45)
at ensureDiscovered (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/transformer/mod-discover-members.js:21:3)
at discoverMembers (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/transformer/mod-discover-members.js:81:5)
at discover (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/transformer/mod-discover-members.js:116:3)
at Object.discover [as mod] (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/transformer/mod-discover-members.js:120:7)
at mod (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/transformer/document-tree-modifiers.js:66:22)
at parse (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/parser/lib/parse.js:82:38)
at async main (/home/runner/work/pixijs/pixijs/node_modules/@webdoc/cli/lib/index.js:136:5)
The mangled() function doesn't check if params is defined, it should probably return something like ${doc.type}:${doc.name} or ${doc.type}:${doc.name}:undefined when that is the case:
Related to https://github.com/pixijs/pixijs/pull/8480
When
@webdoc/parser
parses a method that has no parameters, it crashes with the following error:The
mangled()
function doesn't check ifparams
is defined, it should probably return something like${doc.type}:${doc.name}
or${doc.type}:${doc.name}:undefined
when that is the case:https://github.com/webdoc-labs/webdoc/blob/b7cf3dd0dff474936255b994dabd1598727677ac/packages/webdoc-model/src/doc.js#L356-L363