aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-05 19:55:25 +0000
committerGitHub <noreply@github.com>2020-11-06 03:55:25 +0800
commitc2f6fd5fded46624da3851e3accc3b5165e6d588 (patch)
tree3f09f968b442df51362d1bf70bb377b16bf216b6 /test/compress/functions.js
parentaf4ea3ff6978f079531d011cffc7e2337b3ab48c (diff)
downloadtracifyjs-c2f6fd5fded46624da3851e3accc3b5165e6d588.tar.gz
tracifyjs-c2f6fd5fded46624da3851e3accc3b5165e6d588.zip
fix corner case in `functions` (#4260)
fixes #4259
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 4ed0dc1b..c2ab23f6 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -5115,3 +5115,29 @@ issue_4233: {
}
expect_stdout: "number"
}
+
+issue_4259: {
+ options = {
+ collapse_vars: true,
+ functions: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = function b() {
+ var c = b;
+ for (b in c);
+ };
+ a();
+ console.log(typeof a);
+ }
+ expect: {
+ function a() {
+ for (a in a);
+ }
+ a();
+ console.log(typeof a);
+ }
+ expect_stdout: "function"
+}