Fix other operator output related to <!-- or -->

This commit is contained in:
kzc
2015-10-13 01:17:10 -04:00
parent 1940fb682c
commit dff54a6552
2 changed files with 62 additions and 5 deletions

View File

@@ -1048,8 +1048,9 @@ function OutputStream(options) {
output.print(self.operator);
});
DEFPRINT(AST_Binary, function(self, output){
var op = self.operator;
self.left.print(output);
if (self.operator == ">"
if (op[0] == ">" /* ">>" ">>>" ">" ">=" */
&& self.left instanceof AST_UnaryPostfix
&& self.left.operator == "--") {
// space is mandatory to avoid outputting -->
@@ -1058,8 +1059,8 @@ function OutputStream(options) {
// the space is optional depending on "beautify"
output.space();
}
output.print(self.operator);
if (self.operator == "<"
output.print(op);
if ((op == "<" || op == "<<")
&& self.right instanceof AST_UnaryPrefix
&& self.right.operator == "!"
&& self.right.expression instanceof AST_UnaryPrefix