aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-27 07:00:12 +0800
committerGitHub <noreply@github.com>2017-12-27 07:00:12 +0800
commit5205dbcbf4f522f8b4dc9f9f9727b621982c9f28 (patch)
tree030b4d6115b0b5454543ce52b5b0c1ce58d39b07 /test/compress/drop-unused.js
parent3ff625de7e3d381de43b4703faae402381844c9f (diff)
downloadtracifyjs-5205dbcbf4f522f8b4dc9f9f9727b621982c9f28.tar.gz
tracifyjs-5205dbcbf4f522f8b4dc9f9f9727b621982c9f28.zip
retain recursive function names (#2667)
fixes #2665
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r--test/compress/drop-unused.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 714e1d16..21d4b7ce 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1488,3 +1488,37 @@ issue_2660_2: {
}
expect_stdout: "0"
}
+
+issue_2665: {
+ options = {
+ evaluate: true,
+ inline: true,
+ keep_fargs: false,
+ passes: 2,
+ reduce_funcs: true,
+ reduce_vars: true,
+ side_effects: true,
+ toplevel: true,
+ typeofs: true,
+ unused: true,
+ }
+ input: {
+ var a = 1;
+ function g() {
+ a-- && g();
+ }
+ typeof h == "function" && h();
+ function h() {
+ typeof g == "function" && g();
+ }
+ console.log(a);
+ }
+ expect: {
+ var a = 1;
+ !function g() {
+ a-- && g();
+ }();
+ console.log(a);
+ }
+ expect_stdout: "-1"
+}