aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-07-20 19:32:20 +0100
committerGitHub <noreply@github.com>2020-07-21 02:32:20 +0800
commit61b66e83f1885dd8ad18ff510e38ab601ebf4c5c (patch)
treec53f90a921c60ae62cec5491c1dc9d45739b0c57 /test
parenta5db8cd14c55aa64cb6e5cfb4f98f87aa38504dd (diff)
downloadtracifyjs-61b66e83f1885dd8ad18ff510e38ab601ebf4c5c.tar.gz
tracifyjs-61b66e83f1885dd8ad18ff510e38ab601ebf4c5c.zip
fix corner case in `ie8` (#4016)
fixes #4015
Diffstat (limited to 'test')
-rw-r--r--test/compress/ie8.js45
1 files changed, 43 insertions, 2 deletions
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index df06c625..2115dbc6 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -2544,12 +2544,12 @@ issue_3999: {
expect: {
(function() {
(function f() {
- for (var c = 0; c < 2; c++)
+ for (var o = 0; o < 2; o++)
try {
f[0];
} catch (f) {
var f = 0;
- console.log(c);
+ console.log(o);
}
})();
})(typeof f);
@@ -2593,3 +2593,44 @@ issue_4001: {
}
expect_stdout: "undefined"
}
+
+issue_4015: {
+ rename = true
+ mangle = {
+ ie8: true,
+ toplevel: true,
+ }
+ input: {
+ var n, a = 0, b;
+ function f() {
+ try {
+ throw 0;
+ } catch (b) {
+ (function g() {
+ (function b() {
+ a++;
+ })();
+ })();
+ }
+ }
+ f();
+ console.log(a);
+ }
+ expect: {
+ var n, o = 0, c;
+ function t() {
+ try {
+ throw 0;
+ } catch (c) {
+ (function n() {
+ (function c() {
+ o++;
+ })();
+ })();
+ }
+ }
+ t();
+ console.log(o);
+ }
+ expect_stdout: "1"
+}