diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-11-07 11:36:15 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-11-07 11:36:15 +0200 |
commit | ff388a8d2d6f7777690e792e8cb497acb108e3e5 (patch) | |
tree | 0a0e86318dd491c5ef4a305cd14a277bc256f255 /lib | |
parent | 5346fb94bb186e08e21b60fb19ea7ec902c03784 (diff) | |
download | tracifyjs-ff388a8d2d6f7777690e792e8cb497acb108e3e5.tar.gz tracifyjs-ff388a8d2d6f7777690e792e8cb497acb108e3e5.zip |
parenthesize a Call expression when its parent is New
fix #35
Diffstat (limited to 'lib')
-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 46ed126e..22ee31e4 100644 --- a/lib/output.js +++ b/lib/output.js @@ -468,6 +468,11 @@ function OutputStream(options) { } }); + PARENS(AST_Call, function(output){ + var p = output.parent(); + return p instanceof AST_New && p.expression === this; + }); + PARENS(AST_New, function(output){ var p = output.parent(); // (new Date).getTime(); |