aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-10-13 09:59:40 +0300
committerMihai Bazon <mihai.bazon@gmail.com>2015-10-13 09:59:40 +0300
commitce100728246fbfece9741171febd4f454d404143 (patch)
treebf1977edd71d9ea2f570d154b44b4a2ea8ca65ac /lib
parent1940fb682c7f29d3d82913d0b58d542d034c2556 (diff)
parentdff54a6552c4d6764c85ac3c11c545ad3909f997 (diff)
downloadtracifyjs-ce100728246fbfece9741171febd4f454d404143.tar.gz
tracifyjs-ce100728246fbfece9741171febd4f454d404143.zip
Merge pull request #829 from kzc/html_comment_ops
Fix other operator output producing <!-- or -->
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/output.js b/lib/output.js
index 1bde822e..a3b8f1a7 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -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