diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-23 01:28:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 01:28:09 +0800 |
commit | 5e2cd07d6f6866b1ddae51a4c9b280d2cd527973 (patch) | |
tree | 9ae8b16e7ec90ac1f3d189532a5162d6e28914a6 /test/compress/reduce_vars.js | |
parent | 06166df999f71a033d52e1a6213c36dd5bace2e8 (diff) | |
download | tracifyjs-5e2cd07d6f6866b1ddae51a4c9b280d2cd527973.tar.gz tracifyjs-5e2cd07d6f6866b1ddae51a4c9b280d2cd527973.zip |
handle duplicate function declarations correctly (#2837)
fixes #2836
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r-- | test/compress/reduce_vars.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 33175d1b..4009c35b 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -5360,3 +5360,26 @@ issue_2799_2: { } expect_stdout: "PASS" } + +issue_2836: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f() { + return "FAIL"; + } + console.log(f()); + function f() { + return "PASS"; + } + } + expect: { + console.log(function() { + return "PASS"; + }()); + } + expect_stdout: "PASS" +} |