esrecurse
esrecurse copied to clipboard
Traverse generic nodes
Is there a sense to add generic nodes to traversing, such as Expression, Function, Node, Statement, Declaration, Pattern?
That is done in ast-types, and that feature seems to be quite useful.
For example:
visit(ast, {
//walk into any node
Node: function(node){
}
});
Just an idea.
That sounds very nice.
I'm now planning to generate estraverse and esrecurse node shape spec from estree automatically.
That has category information (such as, Node, Statement etc.) So after that, based on this category, we can implement your suggestion :)
:+1:
Would also like to have a OtherNode property to handle any other node than those already managed.