aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-02-25 15:39:00 +0800
committerGitHub <noreply@github.com>2018-02-25 15:39:00 +0800
commitea2359381b737a60b7879d60b756a575271252b7 (patch)
tree9b14e37ef7b2cc5fad20e2a9569bbd17adb2e16b /test/compress
parent52de64cf16a323797b11fb6fa286f0016be9a7a5 (diff)
downloadtracifyjs-ea2359381b737a60b7879d60b756a575271252b7.tar.gz
tracifyjs-ea2359381b737a60b7879d60b756a575271252b7.zip
fix `collapse_vars` on nested exception (#2955)
fixes #2954
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/collapse_vars.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 688f54c4..ecf64241 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -4665,3 +4665,38 @@ issue_2931: {
}
expect_stdout: "undefined"
}
+
+issue_2954: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ var a = "PASS", b;
+ try {
+ do {
+ b = function() {
+ throw 0;
+ }();
+ a = "FAIL";
+ b && b.c;
+ } while (0);
+ } catch (e) {
+ }
+ console.log(a);
+ }
+ expect: {
+ var a = "PASS", b;
+ try {
+ do {
+ b = function() {
+ throw 0;
+ }();
+ a = "FAIL";
+ b && b.c;
+ } while (0);
+ } catch (e) {
+ }
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+}