aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-11-07 12:26:33 +0200
committerMihai Bazon <mihai@bazon.net>2012-11-07 12:26:33 +0200
commita1ae0c8609ad5ab977dae8afcb96b04594a0cc9a (patch)
tree675f03e3d4fdf679160096e2c45d058e84ed007c /lib
parenta90c1aeafe0ab94cb20e0f0f40fda2b740a3bb15 (diff)
downloadtracifyjs-a1ae0c8609ad5ab977dae8afcb96b04594a0cc9a.tar.gz
tracifyjs-a1ae0c8609ad5ab977dae8afcb96b04594a0cc9a.zip
parenthesize property access when it's the expression in New
refs #35
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/output.js b/lib/output.js
index 2a177684..321c7222 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -468,6 +468,11 @@ function OutputStream(options) {
}
});
+ PARENS(AST_PropAccess, function(output){
+ var p = output.parent();
+ return p instanceof AST_New && p.expression === this;
+ });
+
PARENS(AST_Call, function(output){
var p = output.parent();
return p instanceof AST_New && p.expression === this;