first cut of async/await (#2098)
- async arrow functions not yet supported fixes #1789
This commit is contained in:
@@ -751,6 +751,7 @@ merge(Compressor.prototype, {
|
||||
// Stop immediately if these node types are encountered
|
||||
var parent = tt.parent();
|
||||
if (node instanceof AST_Assign && node.operator != "=" && lhs.equivalent_to(node.left)
|
||||
|| node instanceof AST_Await
|
||||
|| node instanceof AST_Debugger
|
||||
|| node instanceof AST_Destructuring
|
||||
|| node instanceof AST_IterationStatement && !(node instanceof AST_For)
|
||||
@@ -3329,7 +3330,7 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (exp instanceof AST_Function && !self.expression.is_generator) {
|
||||
if (exp instanceof AST_Function && !self.expression.is_generator && !self.expression.async) {
|
||||
var stat = exp.body[0];
|
||||
if (compressor.option("inline") && stat instanceof AST_Return) {
|
||||
var value = stat && stat.value;
|
||||
|
||||
Reference in New Issue
Block a user