benjamn / ast-types

Esprima-compatible implementation of the Mozilla JS Parser API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`export default class {}` breaks scope analysis

tchetwin opened this issue · comments

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:

addPattern(path.get("id"), bindings);

I suspect the fix might be the same as for FunctionDeclaration a couple of lines before, haven't verified this yet:

node.id !== null) {

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