aboutsummaryrefslogtreecommitdiff
path: root/test/compress/merge_vars.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/merge_vars.js')
-rw-r--r--test/compress/merge_vars.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/merge_vars.js b/test/compress/merge_vars.js
index 559832c2..b5148669 100644
--- a/test/compress/merge_vars.js
+++ b/test/compress/merge_vars.js
@@ -2766,3 +2766,37 @@ issue_4139: {
}
expect_stdout: "object"
}
+
+lambda_reuse: {
+ options = {
+ merge_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a, b, f = function() {
+ console.log(a);
+ };
+ f();
+ a = "PASS";
+ b = "FAIL";
+ f();
+ if (console.log(typeof b))
+ console.log(b);
+ }
+ expect: {
+ var a, b, f = function() {
+ console.log(a);
+ };
+ f();
+ a = "PASS";
+ b = "FAIL";
+ f();
+ if (console.log(typeof b))
+ console.log(b);
+ }
+ expect_stdout: [
+ "undefined",
+ "PASS",
+ "string",
+ ]
+}