diff --git a/src/parser/expression.js b/src/parser/expression.js index 64b7f1c18d..82d0fd7f2e 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -968,7 +968,10 @@ pp.parseAwait = function (node) { if (this.isLineTerminator()) { this.unexpected(); } - node.all = this.eat(tt.star); + node.all = false; + if (this.match(tt.star)) { + this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.") + } node.argument = this.parseMaybeUnary(); return this.finishNode(node, "AwaitExpression"); }; diff --git a/test/fixtures/experimental/await/illegal-await-star/actual.js b/test/fixtures/experimental/await/illegal-await-star/actual.js new file mode 100644 index 0000000000..52f31ef5d1 --- /dev/null +++ b/test/fixtures/experimental/await/illegal-await-star/actual.js @@ -0,0 +1,3 @@ +async function bar() { + await* foo(); +} diff --git a/test/fixtures/experimental/await/illegal-await-star/options.json b/test/fixtures/experimental/await/illegal-await-star/options.json new file mode 100644 index 0000000000..85fdea96e9 --- /dev/null +++ b/test/fixtures/experimental/await/illegal-await-star/options.json @@ -0,0 +1,4 @@ +{ + "plugins": ["asyncFunctions"], + "throws": "await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)" +}