From 1eeb505bf4b35eb358601a111c098922418d2904 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sun, 4 Jan 2015 20:35:51 +1100 Subject: [PATCH] no line terminator after contextual async keyword --- acorn.js | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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",