aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/drop-unused.js27
-rw-r--r--test/compress/ie8.js18
2 files changed, 45 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 257d7a76..4448bdd8 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -3085,3 +3085,30 @@ issue_4184: {
}
expect_stdout: "42"
}
+
+issue_4235: {
+ options = {
+ inline: true,
+ reduce_vars: true,
+ unused: true,
+ varify: true,
+ }
+ input: {
+ (function() {
+ {
+ const f = 0;
+ }
+ (function f() {
+ var f = console.log(f);
+ })();
+ })();
+ }
+ expect: {
+ (function() {
+ f = console.log(f),
+ void 0;
+ var f;
+ })();
+ }
+ expect_stdout: "undefined"
+}
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index f2132579..2a7dace3 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -2859,3 +2859,21 @@ issue_4186: {
}
expect_stdout: "NaN"
}
+
+issue_4235: {
+ options = {
+ ie8: true,
+ unused: true,
+ }
+ input: {
+ try {} catch (e) {}
+ console.log(function e() {
+ var e = 0;
+ }());
+ }
+ expect: {
+ try {} catch (e) {}
+ console.log(function e() {}());
+ }
+ expect_stdout: "undefined"
+}