Skip to content

Commit

Permalink
Allow exponential op in await expression
Browse files Browse the repository at this point in the history
Closes #898
  • Loading branch information
marijnh committed Dec 31, 2019
1 parent ca43135 commit 2247347
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion acorn/src/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,6 @@ pp.parseAwait = function() {

let node = this.startNode()
this.next()
node.argument = this.parseMaybeUnary(null, true)
node.argument = this.parseMaybeUnary(null, false)
return this.finishNode(node, "AwaitExpression")
}
2 changes: 2 additions & 0 deletions test/tests-asyncawait.js
Original file line number Diff line number Diff line change
Expand Up @@ -3523,3 +3523,5 @@ test(
test("({ async delete() {} })", {}, {ecmaVersion: 8})

testFail("abc: async function a() {}", "Unexpected token (1:5)", {ecmaVersion: 8})

test("(async() => { await 4 ** 2 })()", {}, {ecmaVersion: 8})

0 comments on commit 2247347

Please sign in to comment.