-
Notifications
You must be signed in to change notification settings - Fork 129
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
Large JS files not fully traversed #37
Comments
Thank you for your report.
No. There's no limitation in estraverse. To reproduce your report, I've created the file, var estraverse = require('../'); // Now I'm in estraverse/tmp directory
var esprima = require('esprima');
var fs = require('fs');
var contents = fs.readFileSync('gistfile1.js', 'utf-8');
var ast = esprima.parse(contents, { loc: true });
console.log(ast);
estraverse.traverse(ast, {
enter: function (node) {
console.log('enter line:(' + node.loc.start.line + ')');
},
leave: function (node) {
console.log('leave line:(' + node.loc.start.line + ')');
}
}); And got the result, https://gist.github.com/Constellation/3994f10c4ab597ec9e66
I guess that you may return some node object from enter function. When using |
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: