aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-01 02:39:40 +0000
committerGitHub <noreply@github.com>2021-01-01 10:39:40 +0800
commit311c074622e0aabbd79b0d701c19f21b8b093b77 (patch)
tree7aace77db4792459c6d1a788bb25e95533d17e8a /test/compress
parenta10c7793bb282a4023337c08c623b7607921655f (diff)
downloadtracifyjs-311c074622e0aabbd79b0d701c19f21b8b093b77.tar.gz
tracifyjs-311c074622e0aabbd79b0d701c19f21b8b093b77.zip
fix corner case in `functions` (#4488)
fixes #4487
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/hoist_vars.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/hoist_vars.js b/test/compress/hoist_vars.js
index 6cd99b06..173aaeaf 100644
--- a/test/compress/hoist_vars.js
+++ b/test/compress/hoist_vars.js
@@ -134,3 +134,27 @@ issue_2295: {
}
}
}
+
+issue_4487: {
+ options = {
+ functions: true,
+ hoist_vars: true,
+ keep_fnames: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = function f() {
+ var f = console.log(typeof f);
+ };
+ var b = a();
+ }
+ expect: {
+ function a() {
+ var a = console.log(typeof a);
+ }
+ a();
+ }
+ expect_stdout: "undefined"
+}