diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-10-22 03:13:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 10:13:11 +0800 |
commit | 23ca7d675f5c7bbd80571ce40b8d951831d359ad (patch) | |
tree | 48cfea7fb69cc8d6aa330d1d4d5ece5be87a75d9 /test/compress/functions.js | |
parent | fd8c0212b8d81b4f1630155bb170214ce87d0e70 (diff) | |
download | tracifyjs-23ca7d675f5c7bbd80571ce40b8d951831d359ad.tar.gz tracifyjs-23ca7d675f5c7bbd80571ce40b8d951831d359ad.zip |
fix corner case in `functions` (#4234)
fixes #4233
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r-- | test/compress/functions.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 4e65b128..4ed0dc1b 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -5076,3 +5076,42 @@ issue_4186: { } expect_stdout: "function" } + +issue_4233: { + options = { + functions: true, + reduce_vars: true, + unused: true, + } + input: { + (function() { + try { + var a = function() {}; + try { + throw 42; + } catch (a) { + (function() { + console.log(typeof a); + })(); + var a; + } + } catch (e) {} + })(); + } + expect: { + (function() { + try { + var a = function() {}; + try { + throw 42; + } catch (a) { + (function() { + console.log(typeof a); + })(); + var a; + } + } catch (e) {} + })(); + } + expect_stdout: "number" +} |