backport test from #2526 (#2534)
authorAlex Lam S.L <alexlamsl@gmail.com>
Wed, 29 Nov 2017 05:32:00 +0000 (13:32 +0800)
committerGitHub <noreply@github.com>
Wed, 29 Nov 2017 05:32:00 +0000 (13:32 +0800)
test/compress/reduce_vars.js

index 82b5ad6..a8c151f 100644 (file)
@@ -4525,3 +4525,21 @@ issue_2485: {
     }
     expect_stdout: "6"
 }
+
+issue_2455: {
+    options = {
+        reduce_vars: true,
+        unused: true,
+    }
+    input: {
+        function foo() {
+            var that = this;
+            for (;;) that.bar();
+        }
+    }
+    expect: {
+        function foo() {
+            for (;;) this.bar();
+        }
+    }
+}