fix corner cases with await (#4350)

fixes #4349
This commit is contained in:
Alex Lam S.L
2020-12-08 03:26:03 +00:00
committed by GitHub
parent 5fba98608c
commit 4733159782
4 changed files with 88 additions and 19 deletions

View File

@@ -1638,6 +1638,7 @@ function parse($TEXT, options) {
function maybe_await() {
var start = S.token;
if (!(S.in_async && is("name", "await"))) return maybe_unary();
S.input.context().regex_allowed = true;
next();
return new AST_Await({
start: start,