aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index ff727da4..ccfb3044 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -6535,3 +6535,33 @@ issue_5096_4: {
}
expect_stdout: "PASS"
}
+
+issue_5098: {
+ options = {
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ (function(o) {
+ function f() {
+ f = console.log;
+ if (o.p++)
+ throw "FAIL";
+ f("PASS");
+ }
+ return f;
+ })({ p: 0 })();
+ }
+ expect: {
+ (function(o) {
+ function f() {
+ f = console.log;
+ if (o.p++)
+ throw "FAIL";
+ f("PASS");
+ }
+ return f;
+ })({ p: 0 })();
+ }
+ expect_stdout: "PASS"
+}