From 0785a15aceaee3f4a31d9693a4230cbf0477ea81 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 17 Oct 2019 09:58:05 +0800 Subject: fix corner case in `dead_code` & `ie8` (#3494) fixes #3493 --- test/compress/ie8.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'test') 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" +} -- cgit v1.2.3