From b0bf126c22aa0d29e8b467b1d6b32692068f1800 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 19 Nov 2014 12:49:41 +1100 Subject: [PATCH] fix up async/await --- acorn.js | 13 +++---------- test/tests-harmony.js | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/acorn.js b/acorn.js index 9fd3bdf6ca..16a80e27d7 100644 --- a/acorn.js +++ b/acorn.js @@ -2075,7 +2075,7 @@ retNode = finishNode(retNode, "AssignmentExpression"); } else { - unexpected + unexpected(); } semicolon(); } @@ -2649,6 +2649,8 @@ } if (options.ecmaVersion >= 6) { isGenerator = eat(_star); + prop.method = false; + prop.shorthand = false; } if (tokType === _name || tokType.keyword) { @@ -2659,18 +2661,9 @@ if (isAsync && isGenerator) { unexpected(); } - if (options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - } parsePropertyName(prop); } else if (tokType === _colon) { - // key could be "async" - if (options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - } isAsync = false; } else if (tokType === _bracketL) { diff --git a/test/tests-harmony.js b/test/tests-harmony.js index 22d120abe7..c2683c3da8 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -14716,7 +14716,7 @@ test("var async; async = 10;", { locations: true }); -test("var {a, async} = b;" { +test("var {a, async} = b;", { "type": "Program", "start": 0, "end": 19,