aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/reduce_vars.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 4af4945f..66c70d5a 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -7725,3 +7725,49 @@ issue_5050: {
"3",
]
}
+
+issue_5055_1: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = "PASS";
+ function f() {
+ console.log(a || "FAIL");
+ }
+ f(0 && (a = 0)(f(this)));
+ }
+ expect: {
+ var a = "PASS";
+ function f() {
+ console.log(a || "FAIL");
+ }
+ f(0);
+ }
+ expect_stdout: "PASS"
+}
+
+issue_5055_2: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = "PASS";
+ function f() {
+ console.log(a || "FAIL");
+ }
+ f(0 && (a = 0)(f(this)));
+ }
+ expect: {
+ var a = "PASS";
+ function f() {
+ console.log(a || "FAIL");
+ }
+ f(0 && (a = 0)(f()));
+ }
+ expect_stdout: "PASS"
+}