Fix parens in +(+x). Close #475
authorMihai Bazon <mihai@bazon.net>
Sun, 27 Apr 2014 17:51:01 +0000 (20:51 +0300)
committerMihai Bazon <mihai@bazon.net>
Sun, 27 Apr 2014 17:51:01 +0000 (20:51 +0300)
lib/output.js

index adbc9a4..4a3bfd5 100644 (file)
@@ -455,7 +455,8 @@ function OutputStream(options) {
 
     PARENS(AST_Unary, function(output){
         var p = output.parent();
-        return p instanceof AST_PropAccess && p.expression === this;
+        return (p instanceof AST_PropAccess && p.expression === this)
+            || (p instanceof AST_Unary && p.operator == "+" && this.operator == "+");
     });
 
     PARENS(AST_Seq, function(output){