diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-11-02 03:34:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-02 03:34:20 +0800 |
commit | dcbf2236c7df7ea4179dddf3e798229181868599 (patch) | |
tree | e1bcacd4a046a0cfe6da2b8c2857b2ef45c290cb /test | |
parent | 24bb2888328a4fb01b7cfb49695b0f84e7120aeb (diff) | |
download | tracifyjs-dcbf2236c7df7ea4179dddf3e798229181868599.tar.gz tracifyjs-dcbf2236c7df7ea4179dddf3e798229181868599.zip |
more tests for #3562 (#3565)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 30 |
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" +} |