Don't consume async when checking for async func decl (#377)

This commit is contained in:
Brian Ng
2017-03-01 11:11:48 -06:00
committed by Henry Zhu
parent fdb0b50c86
commit c8c71684c4
7 changed files with 305 additions and 0 deletions

View File

@@ -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 {