You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to traverse the AST of a JS file with 32482 LOC. I can see that lines after line 27860 has not been traversed. I can see the FunctionExpression node at that line has been entered but not left. Is this a known limitation in estraverse? Is there a way around this? Here is the file I'm trying to analyze.
The text was updated successfully, but these errors were encountered:
...
leave line:(27860)
enter line:(27860)
enter line:(27861)
enter line:(27861)
enter line:(27861)
leave line:(27861)
enter line:(27861)
enter line:(27861)
enter line:(27861)
leave line:(27861)
enter line:(27861)
leave line:(27861)
leave line:(27861)
enter line:(27861)
...
estraverse correctly traverses the file. So I cannot reproduce that.
Could you show me the actual traversing code?
I guess that you may return some node object from enter function. When using estraverse.replace, the target node will be replaced with the returned node.
So when using estraverse in some AltJS langs, you need to care about enter and leave function's return values. For example, while ECMAScript requires explicit return statement, CoffeeScript returns the last evaluated expression implicitly. Sometimes it causes trouble.
I'm trying to traverse the AST of a JS file with 32482 LOC. I can see that lines after line 27860 has not been traversed. I can see the FunctionExpression node at that line has been entered but not left. Is this a known limitation in estraverse? Is there a way around this? Here is the file I'm trying to analyze.
The text was updated successfully, but these errors were encountered: