aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-05-14 19:12:00 +0800
committerGitHub <noreply@github.com>2019-05-14 19:12:00 +0800
commitf87caac9d89061ce005c56384e08fd94ca80d94c (patch)
treec5db0c4e58bf41e3a667902d8de10eddbc47b3ac /test
parentd538a732501f6654ce359ae3ee44a55a873c6a7d (diff)
downloadtracifyjs-f87caac9d89061ce005c56384e08fd94ca80d94c.tar.gz
tracifyjs-f87caac9d89061ce005c56384e08fd94ca80d94c.zip
fix corner case in `hoist_props` (#3412)
fixes #3411
Diffstat (limited to 'test')
-rw-r--r--test/compress/hoist_props.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index 6f309566..b055ae7b 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -862,3 +862,27 @@ issue_3071_3: {
}
expect_stdout: "2"
}
+
+issue_3411: {
+ options = {
+ hoist_props: true,
+ reduce_vars: true,
+ }
+ input: {
+ var c = 1;
+ !function f() {
+ var o = {
+ p: --c && f()
+ };
+ +o || console.log("PASS");
+ }();
+ }
+ expect: {
+ var c = 1;
+ !function f() {
+ var o_p = --c && f();
+ +{} || console.log("PASS");
+ }();
+ }
+ expect_stdout: "PASS"
+}