From: Mihai Bazon Date: Wed, 7 Nov 2012 09:23:17 +0000 (+0200) Subject: add proper parens around unary expressions X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5346fb94;p=UglifyJS.git add proper parens around unary expressions fix #34 --- 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)