ast-types
ast-types copied to clipboard
`export default class {}` breaks scope analysis
The lack of .id in an export ClassDeclaration causes a throw in scope analysis:
https://runkit.com/embed/rz8r6io0kclh (compares with and without providing a name)
The throw originates from:
https://github.com/benjamn/ast-types/blob/a7eaba5ecc79a58acb469cbbf9fe7603cec9f57e/lib/scope.js#L240
I suspect the fix might be the same as for FunctionDeclaration a couple of lines before, haven't verified this yet:
https://github.com/benjamn/ast-types/blob/a7eaba5ecc79a58acb469cbbf9fe7603cec9f57e/lib/scope.js#L235
Edit: I have a patch for this locally with a test, seeking approval to send the PR.
pinging about this
This appears to have been fixed by #467