aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/hoist_props.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index b2dd0270..a46033d5 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -633,3 +633,34 @@ issue_2508_5: {
}
expect_stdout: true
}
+
+issue_2519: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ hoist_props: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ function testFunc() {
+ var dimensions = {
+ minX: 5,
+ maxX: 6,
+ };
+ var scale = 1;
+ var d = {
+ x: (dimensions.maxX + dimensions.minX) / 2,
+ };
+ return d.x * scale;
+ }
+ console.log(testFunc());
+ }
+ expect: {
+ function testFunc() {
+ return 1 * ((6 + 5) / 2);
+ }
+ console.log(testFunc());
+ }
+ expect_stdout: "5.5"
+}