async arrow function IIFE fix (#2184)

fixes #2183
This commit is contained in:
kzc
2017-06-29 22:12:42 -04:00
committed by Alex Lam S.L
parent 07a5a57336
commit a938fe5e1f
3 changed files with 30 additions and 6 deletions

View File

@@ -1045,11 +1045,11 @@ function OutputStream(options) {
var needs_parens = parent instanceof AST_Binary ||
parent instanceof AST_Unary ||
(parent instanceof AST_Call && self === parent.expression);
if (needs_parens) { output.print("(") }
if (self.async) {
output.print("async");
output.space();
}
if (needs_parens) { output.print("(") }
if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) {
self.argnames[0].print(output);
} else {