more tests for #3562 (#3565)
authorAlex Lam S.L <alexlamsl@gmail.com>
Fri, 1 Nov 2019 19:34:20 +0000 (03:34 +0800)
committerGitHub <noreply@github.com>
Fri, 1 Nov 2019 19:34:20 +0000 (03:34 +0800)
test/compress/functions.js

index 0607e85..1208b62 100644 (file)
@@ -3370,3 +3370,33 @@ issue_3512: {
     }
     expect_stdout: "PASS"
 }
+
+issue_3562: {
+    options = {
+        collapse_vars: true,
+        reduce_vars: true,
+    }
+    input: {
+        var a = "PASS";
+        function f(b) {
+            f = function() {
+                console.log(b);
+            };
+            return "FAIL";
+        }
+        a = f(a);
+        f(a);
+    }
+    expect: {
+        var a = "PASS";
+        function f(b) {
+            f = function() {
+                console.log(b);
+            };
+            return "FAIL";
+        }
+        a = f(a);
+        f(a);
+    }
+    expect_stdout: "PASS"
+}