fix corner case with for [await]...of (#4872)

This commit is contained in:
Alex Lam S.L
2021-04-26 05:10:22 +08:00
committed by GitHub
parent 324587f769
commit acf951a5bc
2 changed files with 15 additions and 0 deletions

View File

@@ -1240,6 +1240,7 @@ function parse($TEXT, options) {
}
function for_enum(ctor, init) {
handle_regexp();
var obj = expression();
expect(")");
return new ctor({

View File

@@ -852,6 +852,20 @@ for_async_of: {
node_version: ">=0.12 <16"
}
for_of_regexp: {
input: {
for (var a of /foo/);
}
expect_exact: "for(var a of/foo/);"
}
for_await_of_regexp: {
input: {
for await (var a of /foo/);
}
expect_exact: "for await(var a of/foo/);"
}
issue_3631_1: {
options = {
dead_code: true,