aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-30 02:04:23 +0000
committerGitHub <noreply@github.com>2020-10-30 10:04:23 +0800
commit5d12abc41b9cb4890b937599fa588a53fdb2996b (patch)
tree31329fc174a3420a8e0d290b1fa2592614831552 /test/compress/collapse_vars.js
parent79e5c3f5645b339a98d73cb78e356f61fa618929 (diff)
downloadtracifyjs-5d12abc41b9cb4890b937599fa588a53fdb2996b.tar.gz
tracifyjs-5d12abc41b9cb4890b937599fa588a53fdb2996b.zip
fix corner cases in `collapse_vars` (#4249)
fixes #4248
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index dea01b60..edf4795a 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -8577,3 +8577,28 @@ issue_4242: {
}
expect_stdout: "undefined"
}
+
+issue_4248: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ var a = 0;
+ try {
+ a = 1;
+ b[1];
+ } catch (e) {
+ console.log(a);
+ }
+ }
+ expect: {
+ var a = 0;
+ try {
+ a = 1;
+ b[1];
+ } catch (e) {
+ console.log(a);
+ }
+ }
+ expect_stdout: "1"
+}