fix corner case with for [await]...of

This commit is contained in:
alexlamsl 2021-04-26 03:54:39 +08:00
parent 80efaa2f33
commit c52ae80604
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,