fix comments-only rendering
This commit is contained in:
parent
88a85c0ca8
commit
eef0344cb2
@ -75,7 +75,7 @@ CodeGenerator.prototype.generate = function () {
|
||||
_.each(ast.comments, function (comment) {
|
||||
if (!comment._displayed) comments.push(comment);
|
||||
});
|
||||
if (comments.length) this._printComments(comments);
|
||||
this._printComments(comments);
|
||||
|
||||
return {
|
||||
map: this.map.get(),
|
||||
@ -265,7 +265,13 @@ CodeGenerator.prototype._printComments = function (comments) {
|
||||
var self = this;
|
||||
|
||||
_.each(comments, function (comment) {
|
||||
comment._displayed = true;
|
||||
// find the original comment in the ast and set it as displayed
|
||||
_.each(self.ast.comments, function (origComment) {
|
||||
if (origComment.start === comment.start) {
|
||||
origComment._displayed = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// whitespace before
|
||||
self.newline(self.whitespace.getNewlinesBefore(comment));
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
// from #23
|
||||
/**/
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user