fix await parens for property access and calls (#2181)

fixes #2179
This commit is contained in:
kzc
2017-06-29 21:14:24 -04:00
committed by Alex Lam S.L
parent 945db924fc
commit 07a5a57336
2 changed files with 22 additions and 0 deletions

View File

@@ -673,6 +673,12 @@ function OutputStream(options) {
&& this.operator !== "--";
});
PARENS(AST_Await, function(output){
var p = output.parent();
return p instanceof AST_PropAccess && p.expression === this
|| p instanceof AST_Call && p.expression === this;
});
PARENS(AST_Sequence, function(output){
var p = output.parent();
return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)