aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r--test/compress/collapse_vars.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index ff0837a2..dee370cf 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -7979,3 +7979,39 @@ issue_3884: {
}
expect_stdout: "101 32"
}
+
+issue_3891: {
+ options = {
+ collapse_vars: true,
+ passes: 2,
+ reduce_vars: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ function log(a) {
+ console.log(typeof a);
+ }
+ log(function f() {
+ try {
+ do {
+ var b = function() {}();
+ } while (f = 0, b.p);
+ } catch (e) {
+ var f;
+ b;
+ }
+ });
+ }
+ expect: {
+ function log(a) {
+ console.log(typeof a);
+ }
+ log(function() {
+ try {
+ do {} while ((void 0).p);
+ } catch (e) {}
+ });
+ }
+ expect_stdout: "function"
+}