aboutsummaryrefslogtreecommitdiff
path: root/test/compress/hoist_props.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/hoist_props.js')
-rw-r--r--test/compress/hoist_props.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index 90a7f1d8..b16f7425 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -716,3 +716,29 @@ issue_3021: {
}
expect_stdout: "2 2"
}
+
+issue_3046: {
+ options = {
+ hoist_props: true,
+ reduce_vars: true,
+ }
+ input: {
+ console.log(function(a) {
+ do {
+ var b = {
+ c: a++
+ };
+ } while (b.c && a);
+ return a;
+ }(0));
+ }
+ expect: {
+ console.log(function(a) {
+ do {
+ var b_c = a++;
+ } while (b_c && a);
+ return a;
+ }(0));
+ }
+ expect_stdout: "1"
+}