Don't consume async when checking for async func decl (#377)
This commit is contained in:
@@ -825,6 +825,13 @@ pp.parseExport = function (node) {
|
||||
let needsSemi = false;
|
||||
if (this.eat(tt._function)) {
|
||||
expr = this.parseFunction(expr, true, false, false, true);
|
||||
} else if (
|
||||
this.isContextual("async") &&
|
||||
this.lookahead().type === tt._function
|
||||
) { // async function declaration
|
||||
this.eatContextual("async");
|
||||
this.eat(tt._function);
|
||||
expr = this.parseFunction(expr, true, false, true, true);
|
||||
} else if (this.match(tt._class)) {
|
||||
expr = this.parseClass(expr, true, true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user