diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-12-26 18:29:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-26 18:29:28 +0800 |
commit | 05e7d34ed480429cc26c8eedd675263cd0d94a3e (patch) | |
tree | 6a5717b6de771c860ca0eb25d3680779fa395226 /test/compress/drop-unused.js | |
parent | 86607156e3c68fe2a56d728563691d7dbcb7519d (diff) | |
download | tracifyjs-05e7d34ed480429cc26c8eedd675263cd0d94a3e.tar.gz tracifyjs-05e7d34ed480429cc26c8eedd675263cd0d94a3e.zip |
improve `unused` over duplicate variable names (#2656)
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r-- | test/compress/drop-unused.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index 275e0f76..90206ec6 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -1413,3 +1413,24 @@ issue_2516_2: { Baz(2); } } + +defun_lambda_same_name: { + options = { + toplevel: true, + unused: true, + } + input: { + function f(n) { + return n ? n * f(n - 1) : 1; + } + console.log(function f(n) { + return n ? n * f(n - 1) : 1; + }(5)); + } + expect: { + console.log(function f(n) { + return n ? n * f(n - 1) : 1; + }(5)); + } + expect_stdout: "120" +} |