If supplied, attach filename property to comment node loc. (#80)

This commit is contained in:
Dale Bustad
2016-07-28 14:12:41 -07:00
committed by Daniel Tschinder
parent f576865ce9
commit 4811d617ce
3 changed files with 66 additions and 24 deletions

View File

@@ -33,6 +33,7 @@ function last(stack) {
const pp = Parser.prototype;
pp.addComment = function (comment) {
if (this.filename) comment.loc.filename = this.filename;
this.state.trailingComments.push(comment);
this.state.leadingComments.push(comment);
};