diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-17 22:36:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 06:36:59 +0800 |
commit | e23a10f7f96cda932c605988d2d99bb5225d18a5 (patch) | |
tree | 55bc342a6c9bd3404bf5f5094055e9eaea3fb3d4 /test/compress | |
parent | 884ec4e8a5dc83aa8897bfa7bf49034907311e47 (diff) | |
download | tracifyjs-e23a10f7f96cda932c605988d2d99bb5225d18a5.tar.gz tracifyjs-e23a10f7f96cda932c605988d2d99bb5225d18a5.zip |
fix corner case in `loops` (#4565)
fixes #4564
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/loops.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js index d76e7f74..a6d0277b 100644 --- a/test/compress/loops.js +++ b/test/compress/loops.js @@ -1280,3 +1280,33 @@ issue_4355: { } expect_stdout: "PASS" } + +issue_4564: { + options = { + loops: true, + unused: true, + } + input: { + try { + throw null; + } catch (a) { + var a; + (function() { + for (a in "foo"); + })(); + console.log(a); + } + } + expect: { + try { + throw null; + } catch (a) { + var a; + (function() { + for (a in "foo"); + })(); + console.log(a); + } + } + expect_stdout: "2" +} |