[ES8] async arrow function IIFE fix
This commit is contained in:
parent
945db924fc
commit
2320d00ad3
|
|
@ -1039,11 +1039,11 @@ function OutputStream(options) {
|
||||||
var needs_parens = parent instanceof AST_Binary ||
|
var needs_parens = parent instanceof AST_Binary ||
|
||||||
parent instanceof AST_Unary ||
|
parent instanceof AST_Unary ||
|
||||||
(parent instanceof AST_Call && self === parent.expression);
|
(parent instanceof AST_Call && self === parent.expression);
|
||||||
|
if (needs_parens) { output.print("(") }
|
||||||
if (self.async) {
|
if (self.async) {
|
||||||
output.print("async");
|
output.print("async");
|
||||||
output.space();
|
output.space();
|
||||||
}
|
}
|
||||||
if (needs_parens) { output.print("(") }
|
|
||||||
if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) {
|
if (self.argnames.length === 1 && self.argnames[0] instanceof AST_Symbol) {
|
||||||
self.argnames[0].print(output);
|
self.argnames[0].print(output);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -252,3 +252,12 @@ async_arrow_wait: {
|
||||||
}
|
}
|
||||||
expect_exact: "var a=async(x,y)=>await x(y);"
|
expect_exact: "var a=async(x,y)=>await x(y);"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async_arrow_iife: {
|
||||||
|
input: {
|
||||||
|
(async () => {
|
||||||
|
await fetch({});
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_exact: "(async()=>{await fetch({})})();"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user