diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-04-11 15:44:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-11 15:44:43 +0800 |
commit | 6a916523d458952a7ecde360e5294a5ae807d249 (patch) | |
tree | 0f2c0186503c6d8b7f128f80a9409126d9b7490d /test | |
parent | ba7069d52b8e3eb6eca0fd5b88a20361868bb42c (diff) | |
download | tracifyjs-6a916523d458952a7ecde360e5294a5ae807d249.tar.gz tracifyjs-6a916523d458952a7ecde360e5294a5ae807d249.zip |
fix `inline` of `catch`-scoped variables (#3077)
fixes #3076
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 471ebf7f..650254f4 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -2267,3 +2267,39 @@ issue_3054: { } expect_stdout: "true true" } + +issue_3076: { + options = { + dead_code: true, + inline: true, + sequences: true, + unused: true, + } + input: { + var c = "PASS"; + (function(b) { + var n = 2; + while (--b + function() { + e && (c = "FAIL"); + e = 5; + return 1; + try { + var a = 5; + } catch (e) { + var e; + } + }().toString() && --n > 0); + })(2); + console.log(c); + } + expect: { + var c = "PASS"; + (function(b) { + var n = 2; + while (--b + (e = void 0, e && (c = "FAIL"), e = 5, 1).toString() && --n > 0); + var e; + })(2), + console.log(c); + } + expect_stdout: "PASS" +} |