aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/reduce_vars.js112
1 files changed, 112 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 1acd902b..25f95ff8 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -3542,3 +3542,115 @@ issue_2423_6: {
"2",
]
}
+
+issue_2440_eval_1: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ function foo() {
+ return bar();
+ }
+ baz = {
+ quux: foo
+ };
+ exec = function() {
+ return eval("foo()");
+ };
+ }
+ expect: {
+ function foo() {
+ return bar();
+ }
+ baz = {
+ quux: foo
+ };
+ exec = function() {
+ return eval("foo()");
+ };
+ }
+}
+
+issue_2440_eval_2: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ baz = {
+ quux: foo
+ };
+ exec = function() {
+ return eval("foo()");
+ };
+ function foo() {
+ return bar();
+ }
+ }
+ expect: {
+ baz = {
+ quux: foo
+ };
+ exec = function() {
+ return eval("foo()");
+ };
+ function foo() {
+ return bar();
+ }
+ }
+}
+
+issue_2440_with_1: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ function foo() {
+ return bar();
+ }
+ baz = {
+ quux: foo
+ };
+ with (o) whatever();
+ }
+ expect: {
+ function foo() {
+ return bar();
+ }
+ baz = {
+ quux: foo
+ };
+ with (o) whatever();
+ }
+}
+
+issue_2440_with_2: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ baz = {
+ quux: foo
+ };
+ with (o) whatever();
+ function foo() {
+ return bar();
+ }
+ }
+ expect: {
+ baz = {
+ quux: foo
+ };
+ with (o) whatever();
+ function foo() {
+ return bar();
+ }
+ }
+}