aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/collapse_vars.js2
-rw-r--r--test/compress/functions.js2
-rw-r--r--test/compress/ie8.js108
3 files changed, 110 insertions, 2 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 090f3cf8..2381333a 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -4388,7 +4388,7 @@ replace_all_var: {
}
replace_all_var_scope: {
- rename = true;
+ rename = true
options = {
collapse_vars: true,
unused: true,
diff --git a/test/compress/functions.js b/test/compress/functions.js
index f01a02e8..92a0f99c 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -1150,7 +1150,7 @@ issue_2620_3: {
}
issue_2620_4: {
- rename = true,
+ rename = true
options = {
dead_code: true,
evaluate: true,
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index 94b83de6..9fc2becd 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -1081,3 +1081,111 @@ issue_3471_ie8: {
}
expect_stdout: true
}
+
+issue_3473: {
+ rename = true
+ mangle = {
+ ie8: false,
+ toplevel: false,
+ }
+ input: {
+ var d = 42, a = 100, b = 10, c = 0;
+ (function b() {
+ try {
+ c++;
+ } catch (b) {}
+ })();
+ console.log(a, b, c);
+ }
+ expect: {
+ var d = 42, a = 100, b = 10, c = 0;
+ (function a() {
+ try {
+ c++;
+ } catch (a) {}
+ })();
+ console.log(a, b, c);
+ }
+ expect_stdout: "100 10 1"
+}
+
+issue_3473_ie8: {
+ rename = true
+ mangle = {
+ ie8: true,
+ toplevel: false,
+ }
+ input: {
+ var d = 42, a = 100, b = 10, c = 0;
+ (function b() {
+ try {
+ c++;
+ } catch (b) {}
+ })();
+ console.log(a, b, c);
+ }
+ expect: {
+ var d = 42, a = 100, b = 10, c = 0;
+ (function b() {
+ try {
+ c++;
+ } catch (b) {}
+ })();
+ console.log(a, b, c);
+ }
+ expect_stdout: "100 10 1"
+}
+
+issue_3473_toplevel: {
+ rename = true
+ mangle = {
+ ie8: false,
+ toplevel: true,
+ }
+ input: {
+ var d = 42, a = 100, b = 10, c = 0;
+ (function b() {
+ try {
+ c++;
+ } catch (b) {}
+ })();
+ console.log(a, b, c);
+ }
+ expect: {
+ var c = 42, o = 100, n = 10, t = 0;
+ (function c() {
+ try {
+ t++;
+ } catch (c) {}
+ })();
+ console.log(o, n, t);
+ }
+ expect_stdout: "100 10 1"
+}
+
+issue_3473_ie8_toplevel: {
+ rename = true
+ mangle = {
+ ie8: true,
+ toplevel: true,
+ }
+ input: {
+ var d = 42, a = 100, b = 10, c = 0;
+ (function b() {
+ try {
+ c++;
+ } catch (b) {}
+ })();
+ console.log(a, b, c);
+ }
+ expect: {
+ var c = 42, o = 100, n = 10, t = 0;
+ (function n() {
+ try {
+ t++;
+ } catch (n) {}
+ })();
+ console.log(o, n, t);
+ }
+ expect_stdout: "100 10 1"
+}