diff --git a/acorn.js b/acorn.js index 2738f6bbd7..234b3e9b07 100644 --- a/acorn.js +++ b/acorn.js @@ -2609,6 +2609,13 @@ // normal functions if (tokType === _function) { + if (isStatement) { + // no line terminator after `async` contextual keyword + if (tokType === _semi || canInsertSemicolon()) { + return id; + } + } + next(); return parseFunction(node, isStatement, true); } diff --git a/package.json b/package.json index 6997fe3d42..29c3f6ce5f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "acorn-6to5", "description": "Acorn fork used by 6to5", "main": "acorn.js", - "version": "0.11.1-8", + "version": "0.11.1-9", "maintainers": [ { "name": "Marijn Haverbeke",