aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-26 18:29:28 +0800
committerGitHub <noreply@github.com>2017-12-26 18:29:28 +0800
commit05e7d34ed480429cc26c8eedd675263cd0d94a3e (patch)
tree6a5717b6de771c860ca0eb25d3680779fa395226 /test/compress/drop-unused.js
parent86607156e3c68fe2a56d728563691d7dbcb7519d (diff)
downloadtracifyjs-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.js21
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"
+}