Add comments property to babylon.parseExpression() result

This commit is contained in:
Joseph Frazier 2017-07-14 10:22:23 -04:00 committed by Brian Ng
parent 688a1e523e
commit f9b8fa1ddf
2 changed files with 19 additions and 0 deletions

View File

@ -73,6 +73,7 @@ export default class ExpressionParser extends LValParser {
if (!this.match(tt.eof)) {
this.unexpected();
}
expr.comments = this.state.comments;
return expr;
}

View File

@ -32,5 +32,23 @@
}
}
}
],
"comments": [
{
"type": "CommentLine",
"value": " my comment",
"start": 4,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 17
}
}
}
]
}