diff options
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r-- | test/compress/drop-unused.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index c702cfaf..ddf90bfa 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -1114,3 +1114,36 @@ issue_1838: { "}", ] } + +var_catch_toplevel: { + options = { + conditionals: true, + negate_iife: true, + reduce_vars: true, + side_effects: true, + toplevel: true, + unused: true, + } + input: { + function f() { + a--; + try { + a++; + } catch(a) { + if (a) var a; + var a = 10; + } + } + f(); + } + expect: { + !function() { + a--; + try { + a++; + } catch(a) { + var a; + } + }(); + } +} |