convert comment node types from babel to espree - ref facebook/react#4449

This commit is contained in:
Sebastian McKenzie 2015-07-21 22:34:14 +01:00
parent 61555c6ebd
commit e7aecdce71

View File

@ -447,6 +447,14 @@ exports.parse = function (code) {
ast.tokens = acornToEsprima.toTokens(tokens);
// add comments
for (var i = 0; i < comments.length; i++) {
var comment = comments[i];
if (comment.type === "CommentBlock") {
comment.type = "Block";
} else if (comment.type === "CommentLine") {
comment.type = "Line";
}
}
ast.comments = comments;
exports.attachComments(ast, comments, tokens);