aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-11-02 03:34:20 +0800
committerGitHub <noreply@github.com>2019-11-02 03:34:20 +0800
commitdcbf2236c7df7ea4179dddf3e798229181868599 (patch)
treee1bcacd4a046a0cfe6da2b8c2857b2ef45c290cb /test
parent24bb2888328a4fb01b7cfb49695b0f84e7120aeb (diff)
downloadtracifyjs-dcbf2236c7df7ea4179dddf3e798229181868599.tar.gz
tracifyjs-dcbf2236c7df7ea4179dddf3e798229181868599.zip
more tests for #3562 (#3565)
Diffstat (limited to 'test')
-rw-r--r--test/compress/functions.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 0607e85c..1208b62d 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -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"
+}