Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported ESTree node types with the walker #555

Open
ehmicky opened this issue May 24, 2017 · 3 comments
Open

Unsupported ESTree node types with the walker #555

ehmicky opened this issue May 24, 2017 · 3 comments

Comments

@ehmicky
Copy link
Contributor

ehmicky commented May 24, 2017

The walker at src/walk/index.js does not catch all the node types defined by the ESTree spec.
Example:

const node = acorn.parse('switch (1) { case 1: break; }');
assert(node.body[0].cases[0].type === 'SwitchCase');
let called = false;
walk.simple(node, {
  SwitchCase(){ called = true; }
});
assert(called);

I found this problem for the following ESTree types: SwitchCase, ClassBody, TemplateElement, ExportSpecifier.
The following abstract types are also missing: Declaration, ModuleDeclaration.

@marijnh
Copy link
Member

marijnh commented May 24, 2017

The code was written against an old version of the format. It's probably straightforward to add these -- want to submit a pull request?

@ehmicky
Copy link
Contributor Author

ehmicky commented May 25, 2017

Done in #558

@michael-ts
Copy link

michael-ts commented May 6, 2022

What's the status of this? I apparently ran into this issue where my SwitchCase wasn't being called in walk.recursive; it seems this was a known but which has been fixed but following the link it appears that PR hasn't been merged due to hesistancy to merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants