add Safari workaround for await (#2528)

fixes #2344
This commit is contained in:
Alex Lam S.L
2017-11-29 00:20:36 +08:00
committed by GitHub
parent 755e2a62c6
commit aacf760fb4
2 changed files with 31 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ function OutputStream(options) {
preserve_line : false,
quote_keys : false,
quote_style : 0,
safari10 : false,
semicolons : true,
shebang : true,
shorthand : undefined,
@@ -677,7 +678,8 @@ function OutputStream(options) {
PARENS(AST_Await, function(output){
var p = output.parent();
return p instanceof AST_PropAccess && p.expression === this
|| p instanceof AST_Call && p.expression === this;
|| p instanceof AST_Call && p.expression === this
|| output.option("safari10") && p instanceof AST_UnaryPrefix;
});
PARENS(AST_Sequence, function(output){