Fix parens for AST_New
authorMihai Bazon <mihai@bazon.net>
Wed, 6 Feb 2013 09:28:49 +0000 (11:28 +0200)
committerMihai Bazon <mihai@bazon.net>
Wed, 6 Feb 2013 09:28:49 +0000 (11:28 +0200)
Close #114

lib/output.js

index 5e66820..27b35fe 100644 (file)
@@ -509,7 +509,7 @@ function OutputStream(options) {
     PARENS(AST_New, function(output){
         var p = output.parent();
         if (no_constructor_parens(this, output)
-            && (p instanceof AST_Dot // (new Date).getTime()
+            && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]()
                 || p instanceof AST_Call && p.expression === this)) // (new foo)(bar)
             return true;
     });