aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-03 00:56:06 +0800
committerGitHub <noreply@github.com>2017-03-03 00:56:06 +0800
commitfe9227a41bd13a8e58be1e17636a96d09e0fd956 (patch)
tree1710280249d949e7303e74853376b2b5a03c9139 /test
parentb49e142a26094ccb0a6e9f597e7363ba02280eb4 (diff)
downloadtracifyjs-fe9227a41bd13a8e58be1e17636a96d09e0fd956.tar.gz
tracifyjs-fe9227a41bd13a8e58be1e17636a96d09e0fd956.zip
fix reference marking in for-in loops (#1535)
fixes #1533
Diffstat (limited to 'test')
-rw-r--r--test/compress/reduce_vars.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index e38c317b..87b1fc2e 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -589,3 +589,39 @@ inner_var_for_in: {
x(1, b, c, d);
}
}
+
+issue_1533_1: {
+ options = {
+ collapse_vars: true,
+ reduce_vars: true,
+ }
+ input: {
+ var id = "";
+ for (id in {break: "me"})
+ console.log(id);
+ }
+ expect: {
+ var id = "";
+ for (id in {break: "me"})
+ console.log(id);
+ }
+}
+
+issue_1533_2: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ }
+ input: {
+ var id = "";
+ for (var id in {break: "me"})
+ console.log(id);
+ console.log(id);
+ }
+ expect: {
+ var id = "";
+ for (var id in {break: "me"})
+ console.log(id);
+ console.log(id);
+ }
+}