aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-06 10:29:13 +0800
committerGitHub <noreply@github.com>2019-10-06 10:29:13 +0800
commit931ac666382081a80267ab01ecfa5712162d5837 (patch)
tree9024632453f6ee9a339e47e9c761ddfb91758325 /test/compress
parent35338a100f62d881de06eebdaa1ed98c7212cfc4 (diff)
downloadtracifyjs-931ac666382081a80267ab01ecfa5712162d5837.tar.gz
tracifyjs-931ac666382081a80267ab01ecfa5712162d5837.zip
fix corner case in `hoist_props` (#3452)
fixes #3440
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/hoist_props.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index b055ae7b..0d8e771a 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -886,3 +886,31 @@ issue_3411: {
}
expect_stdout: "PASS"
}
+
+issue_3440: {
+ options = {
+ hoist_props: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ function f() {
+ console.log(o.p);
+ }
+ var o = {
+ p: "PASS",
+ };
+ return f;
+ })()();
+ }
+ expect: {
+ (function() {
+ var o_p = "PASS";
+ return function() {
+ console.log(o_p);
+ };
+ })()();
+ }
+ expect_stdout: "PASS"
+}