fix corner case in dead_code & ie8 (#3494)

fixes #3493
This commit is contained in:
Alex Lam S.L
2019-10-17 09:58:05 +08:00
committed by GitHub
parent b1279a46d9
commit 0785a15ace
2 changed files with 76 additions and 2 deletions

View File

@@ -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"
}