aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r--test/compress/drop-unused.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 0b76f6f6..160b96b4 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -2992,3 +2992,34 @@ issue_4146: {
}
expect_stdout: "function"
}
+
+single_use_catch_redefined: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = 1;
+ try {
+ throw 2;
+ } catch (a) {
+ function g() {
+ return a;
+ }
+ }
+ console.log(g());
+ }
+ expect: {
+ var a = 1;
+ try {
+ throw 2;
+ } catch (a) {
+ function g() {
+ return a;
+ }
+ }
+ console.log(g());
+ }
+ expect_stdout: true
+}