aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-10-13 14:32:08 +0300
committerMihai Bazon <mihai@bazon.net>2012-10-13 14:32:08 +0300
commitb071c9d079e3acbfb521a6634364c5816d3be280 (patch)
treee89ac0a0a53bc62c9f593e8e0687dc8d25a09490
parent851b48e4a3ecdbe7d77ec827f94d67092d2890ef (diff)
downloadtracifyjs-b071c9d079e3acbfb521a6634364c5816d3be280.tar.gz
tracifyjs-b071c9d079e3acbfb521a6634364c5816d3be280.zip
add parens to AST_Seq whose parent is AST_Unary
-rw-r--r--lib/output.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js
index 25b601ef..674ae4db 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -403,6 +403,7 @@ function OutputStream(options) {
PARENS(AST_Seq, function(output){
var p = output.parent();
return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
+ || p instanceof AST_Unary // !(foo, bar, baz)
|| p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 7
|| p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4
|| p instanceof AST_Dot // (1, {foo:2}).foo ==> 2