only print misisng ast.comments when available

This commit is contained in:
Sebastian McKenzie 2015-05-09 17:32:47 +01:00
parent 4deed35212
commit 2744b9f31f

View File

@ -105,11 +105,13 @@ class CodeGenerator {
this.print(ast);
var comments = [];
for (var comment of (ast.comments: Array)) {
if (!comment._displayed) comments.push(comment);
if (ast.comments) {
var comments = [];
for (var comment of (ast.comments: Array)) {
if (!comment._displayed) comments.push(comment);
}
this._printComments(comments);
}
this._printComments(comments);
return {
map: this.map.get(),