fix files only containg comments not being output - fixes #259
This commit is contained in:
parent
302e6f4caa
commit
88a85c0ca8
@ -1,3 +1,7 @@
|
||||
# 1.14.18
|
||||
|
||||
* Fix files only containg comments not being output.
|
||||
|
||||
# 1.14.17
|
||||
|
||||
* Add default initializer to let variables within loop bodies.
|
||||
|
||||
@ -71,6 +71,12 @@ CodeGenerator.prototype.generate = function () {
|
||||
|
||||
this.print(ast);
|
||||
|
||||
var comments = [];
|
||||
_.each(ast.comments, function (comment) {
|
||||
if (!comment._displayed) comments.push(comment);
|
||||
});
|
||||
if (comments.length) this._printComments(comments);
|
||||
|
||||
return {
|
||||
map: this.map.get(),
|
||||
code: this.buffer.get()
|
||||
@ -259,6 +265,8 @@ CodeGenerator.prototype._printComments = function (comments) {
|
||||
var self = this;
|
||||
|
||||
_.each(comments, function (comment) {
|
||||
comment._displayed = true;
|
||||
|
||||
// whitespace before
|
||||
self.newline(self.whitespace.getNewlinesBefore(comment));
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
// from #23
|
||||
/**/
|
||||
/*
|
||||
*/
|
||||
|
||||
test
|
||||
Loading…
x
Reference in New Issue
Block a user