diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-11-07 11:23:17 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-11-07 11:23:50 +0200 |
commit | 5346fb94bb186e08e21b60fb19ea7ec902c03784 (patch) | |
tree | d7e4fb0b239e810874c124b594d8870f6c7bbe92 /lib/output.js | |
parent | a4f6d46118c0d9d1d84a9238d8ef4e57279caac3 (diff) | |
download | tracifyjs-5346fb94bb186e08e21b60fb19ea7ec902c03784.tar.gz tracifyjs-5346fb94bb186e08e21b60fb19ea7ec902c03784.zip |
add proper parens around unary expressions
fix #34
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js index ab44222f..46ed126e 100644 --- a/lib/output.js +++ b/lib/output.js @@ -410,6 +410,11 @@ function OutputStream(options) { return first_in_statement(output); }); + PARENS(AST_Unary, function(output){ + var p = output.parent(); + return p instanceof AST_PropAccess; + }); + PARENS(AST_Seq, function(output){ var p = output.parent(); return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) |