Skip to content

Commit 848d14e

Browse files
committed
Make await x ** y fail to parse
Closes #984
1 parent de974c4 commit 848d14e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

acorn/src/expression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,6 @@ pp.parseAwait = function() {
10291029

10301030
let node = this.startNode()
10311031
this.next()
1032-
node.argument = this.parseMaybeUnary(null, false)
1032+
node.argument = this.parseMaybeUnary(null, true)
10331033
return this.finishNode(node, "AwaitExpression")
10341034
}

test/tests-asyncawait.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3524,6 +3524,6 @@ test("({ async delete() {} })", {}, {ecmaVersion: 8})
35243524

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

3527-
test("(async() => { await 4 ** 2 })()", {}, {ecmaVersion: 8})
3527+
testFail("(async() => { await 4 ** 2 })()", "Unexpected token (1:22)", {ecmaVersion: 8})
35283528

35293529
testFail("4 + async() => 2", "Unexpected token (1:12)", {ecmaVersion: 8, loose: false})

0 commit comments

Comments
 (0)