aboutsummaryrefslogtreecommitdiff
path: root/test/compress/ie8.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-17 09:58:05 +0800
committerGitHub <noreply@github.com>2019-10-17 09:58:05 +0800
commit0785a15aceaee3f4a31d9693a4230cbf0477ea81 (patch)
tree35c3685bd3adeca406922f61021659549965950f /test/compress/ie8.js
parentb1279a46d9801bbc3eee8c4ea90422dd7582b928 (diff)
downloadtracifyjs-0785a15aceaee3f4a31d9693a4230cbf0477ea81.tar.gz
tracifyjs-0785a15aceaee3f4a31d9693a4230cbf0477ea81.zip
fix corner case in `dead_code` & `ie8` (#3494)
fixes #3493
Diffstat (limited to 'test/compress/ie8.js')
-rw-r--r--test/compress/ie8.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index 223da329..4637451c 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -1887,3 +1887,75 @@ issue_3486_ie8: {
}
expect_stdout: "PASS"
}
+
+issue_3493: {
+ options = {
+ dead_code: true,
+ ie8: false,
+ }
+ input: {
+ var c = "PASS";
+ (function() {
+ try {
+ (function a() {
+ throw {};
+ })();
+ } catch (a) {
+ a >>= 0;
+ a && (c = "FAIL");
+ }
+ })();
+ console.log(c);
+ }
+ expect: {
+ var c = "PASS";
+ (function() {
+ try {
+ (function a() {
+ throw {};
+ })();
+ } catch (a) {
+ a >>= 0;
+ a && (c = "FAIL");
+ }
+ })();
+ console.log(c);
+ }
+ expect_stdout: "PASS"
+}
+
+issue_3493_ie8: {
+ options = {
+ dead_code: true,
+ ie8: true,
+ }
+ input: {
+ var c = "PASS";
+ (function() {
+ try {
+ (function a() {
+ throw {};
+ })();
+ } catch (a) {
+ a >>= 0;
+ a && (c = "FAIL");
+ }
+ })();
+ console.log(c);
+ }
+ expect: {
+ var c = "PASS";
+ (function() {
+ try {
+ (function a() {
+ throw {};
+ })();
+ } catch (a) {
+ a >>= 0;
+ a && (c = "FAIL");
+ }
+ })();
+ console.log(c);
+ }
+ expect_stdout: "PASS"
+}