aboutsummaryrefslogtreecommitdiff
path: root/test/compress/ie8.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-15 14:18:12 +0800
committerGitHub <noreply@github.com>2019-10-15 14:18:12 +0800
commitf86f615d836049fbae03271b59a67b8a9ca90ef7 (patch)
tree0aefbd7ca083b19abcd7392f25df053ba469c5b6 /test/compress/ie8.js
parentd3d1d11926de43fc1ec74ae3a4d24a884d80d91f (diff)
downloadtracifyjs-f86f615d836049fbae03271b59a67b8a9ca90ef7.tar.gz
tracifyjs-f86f615d836049fbae03271b59a67b8a9ca90ef7.zip
fix corner case in `ie8` & `mangle` (#3476)
fixes #3475
Diffstat (limited to 'test/compress/ie8.js')
-rw-r--r--test/compress/ie8.js132
1 files changed, 132 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index 9fc2becd..586955d9 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -1189,3 +1189,135 @@ issue_3473_ie8_toplevel: {
}
expect_stdout: "100 10 1"
}
+
+issue_3475: {
+ rename = true
+ mangle = {
+ ie8: false,
+ toplevel: false,
+ }
+ input: {
+ "ooooo ddddd";
+ var a = "FAIL";
+ try {
+ throw 42;
+ } catch (b) {
+ (function f() {
+ a = "PASS";
+ })();
+ }
+ console.log(a);
+ }
+ expect: {
+ "ooooo ddddd";
+ var a = "FAIL";
+ try {
+ throw 42;
+ } catch (o) {
+ (function o() {
+ a = "PASS";
+ })();
+ }
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+}
+
+issue_3475_ie8: {
+ rename = true
+ mangle = {
+ ie8: true,
+ toplevel: false,
+ }
+ input: {
+ "ooooo ddddd";
+ var a = "FAIL";
+ try {
+ throw 42;
+ } catch (b) {
+ (function f() {
+ a = "PASS";
+ })();
+ }
+ console.log(a);
+ }
+ expect: {
+ "ooooo ddddd";
+ var a = "FAIL";
+ try {
+ throw 42;
+ } catch (b) {
+ (function f() {
+ a = "PASS";
+ })();
+ }
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+}
+
+issue_3475_toplevel: {
+ rename = true
+ mangle = {
+ ie8: false,
+ toplevel: true,
+ }
+ input: {
+ "ooooo ddddd";
+ var a = "FAIL";
+ try {
+ throw 42;
+ } catch (b) {
+ (function f() {
+ a = "PASS";
+ })();
+ }
+ console.log(a);
+ }
+ expect: {
+ "ooooo ddddd";
+ var d = "FAIL";
+ try {
+ throw 42;
+ } catch (o) {
+ (function o() {
+ d = "PASS";
+ })();
+ }
+ console.log(d);
+ }
+ expect_stdout: "PASS"
+}
+
+issue_3475_ie8_toplevel: {
+ rename = true
+ mangle = {
+ ie8: true,
+ toplevel: true,
+ }
+ input: {
+ "ooooo ddddd";
+ var a = "FAIL";
+ try {
+ throw 42;
+ } catch (b) {
+ (function f() {
+ a = "PASS";
+ })();
+ }
+ console.log(a);
+ }
+ expect: {
+ "ooooo ddddd";
+ var o = "FAIL";
+ try {
+ throw 42;
+ } catch (d) {
+ (function c() {
+ o = "PASS";
+ })();
+ }
+ console.log(o);
+ }
+ expect_stdout: "PASS"
+}