convert comment node types from babel to espree - ref facebook/react#4449
This commit is contained in:
parent
61555c6ebd
commit
e7aecdce71
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user