From 5346fb94bb186e08e21b60fb19ea7ec902c03784 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 7 Nov 2012 11:23:17 +0200 Subject: add proper parens around unary expressions fix #34 --- lib/output.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/output.js') 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) -- cgit v1.2.3