diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-05-14 19:12:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 19:12:00 +0800 |
commit | f87caac9d89061ce005c56384e08fd94ca80d94c (patch) | |
tree | c5db0c4e58bf41e3a667902d8de10eddbc47b3ac /test | |
parent | d538a732501f6654ce359ae3ee44a55a873c6a7d (diff) | |
download | tracifyjs-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.js | 24 |
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" +} |