remove estraverse attach comments method, fix up tests

This commit is contained in:
Henry Zhu 2015-07-22 00:36:03 -04:00
parent 2bb5101112
commit 9c452f5b14

View File

@ -363,8 +363,6 @@ function monkeypatch() {
}
exports.attachComments = function (ast, comments, tokens) {
estraverse.attachComments(ast, comments, tokens);
if (comments.length) {
var firstComment = comments[0];
var lastComment = comments[comments.length - 1];
@ -456,7 +454,7 @@ exports.parse = function (code) {
}
}
ast.comments = comments;
exports.attachComments(ast, comments, tokens);
exports.attachComments(ast, comments, ast.tokens);
// transform esprima and acorn divergent nodes
acornToEsprima.toAST(ast);