aboutsummaryrefslogtreecommitdiff
path: root/test/compress/loops.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-04-26 05:10:22 +0800
committerGitHub <noreply@github.com>2021-04-26 05:10:22 +0800
commitacf951a5bc9d79dc2614d880758e3e7f79f975ae (patch)
tree1793e177344c8fea7e9bb2539c13cd2c074fcaf0 /test/compress/loops.js
parent324587f76980114e030c59165a60bd285ca05be0 (diff)
downloadtracifyjs-acf951a5bc9d79dc2614d880758e3e7f79f975ae.tar.gz
tracifyjs-acf951a5bc9d79dc2614d880758e3e7f79f975ae.zip
fix corner case with `for [await]...of` (#4872)
Diffstat (limited to 'test/compress/loops.js')
-rw-r--r--test/compress/loops.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index 4ba0d075..c1f075cc 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -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,