diff options
-rw-r--r-- | lib/output.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/output.js b/lib/output.js index df2692ad..e7f3f4dd 100644 --- a/lib/output.js +++ b/lib/output.js @@ -989,7 +989,18 @@ function OutputStream(options) { self.left.print(output); output.space(); output.print(self.operator); - output.space(); + if (self.operator == "<" + && self.right instanceof AST_UnaryPrefix + && self.right.operator == "!" + && self.right.expression instanceof AST_UnaryPrefix + && self.right.expression.operator == "--") { + // space is mandatory to avoid outputting <!-- + // http://javascript.spec.whatwg.org/#comment-syntax + output.print(" "); + } else { + // the space is optional depending on "beautify" + output.space(); + } self.right.print(output); }); DEFPRINT(AST_Conditional, function(self, output){ |