Fix export default async function to be FunctionDeclaration (#324)

This commit is contained in:
Daniel Tschinder
2017-01-27 19:43:06 +01:00
committed by GitHub
parent 9929baaca8
commit d2faddf0d9
4 changed files with 179 additions and 0 deletions

View File

@@ -837,6 +837,8 @@ pp.parseExport = function (node) {
let needsSemi = false;
if (this.eat(tt._function)) {
expr = this.parseFunction(expr, true, false, false, true);
} else if (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 {