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

traversing only callee of CallExpression breaks visitor flow #295

Open
retorquere opened this issue May 9, 2024 · 0 comments
Open

traversing only callee of CallExpression breaks visitor flow #295

retorquere opened this issue May 9, 2024 · 0 comments

Comments

@retorquere
Copy link

I had expected this to print f.

const recast = require('@putout/recast');

const ast = recast.parse('f(3)')

recast.visit(ast, {
  visitCallExpression: function(path) {
    this.traverse(path.get('callee')) // if I replace this with this.traverse(path) it works
  },
  visitIdentifier: function(path) {
    console.log(path.node.name)
    return false
  }
})
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

1 participant