aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-05-19 22:11:39 +0100
committerGitHub <noreply@github.com>2021-05-20 05:11:39 +0800
commitd6152e6a76908223cace651898e12a3b3c9a445d (patch)
treee208e034823e2fb26aada3949db6a3cd321c88dd /test/compress/collapse_vars.js
parentd930c705f6064448c7e6cba8e0e9e8d46d5e3762 (diff)
downloadtracifyjs-d6152e6a76908223cace651898e12a3b3c9a445d.tar.gz
tracifyjs-d6152e6a76908223cace651898e12a3b3c9a445d.zip
fix corner case in `collapse_vars` (#4946)
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 83eccdf1..d2f27299 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -9245,3 +9245,37 @@ issue_4935: {
}
expect_stdout: "1 0"
}
+
+inline_throw: {
+ options = {
+ collapse_vars: true,
+ inline: true,
+ keep_fargs: false,
+ unused: true,
+ }
+ input: {
+ try {
+ (function() {
+ return function(a) {
+ return function(b) {
+ throw b;
+ }(a);
+ };
+ })()("PASS");
+ } catch (e) {
+ console.log(e);
+ }
+ }
+ expect: {
+ try {
+ (function(a) {
+ return function() {
+ throw a;
+ }();
+ })("PASS");
+ } catch (e) {
+ console.log(e);
+ }
+ }
+ expect_stdout: "PASS"
+}