aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/hoist_props.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/compress/hoist_props.js b/test/compress/hoist_props.js
index 597db4bc..2b4abff1 100644
--- a/test/compress/hoist_props.js
+++ b/test/compress/hoist_props.js
@@ -786,6 +786,32 @@ issue_3071_1: {
reduce_vars: true,
sequences: true,
side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function() {
+ var obj = {};
+ obj.one = 1;
+ obj.two = 2;
+ console.log(obj.one, obj.two);
+ })();
+ }
+ expect: {
+ console.log(1, 2);
+ }
+ expect_stdout: "1 2"
+}
+
+issue_3071_1_toplevel: {
+ options = {
+ evaluate: true,
+ hoist_props: true,
+ inline: true,
+ join_vars: true,
+ passes: 3,
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
toplevel: true,
unused: true,
}
@@ -1094,3 +1120,24 @@ object_super: {
expect_stdout: "PASS"
node_version: ">=4"
}
+
+issue_4985: {
+ options = {
+ hoist_props: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = { p: 42 };
+ console.log(function() {
+ a;
+ }());
+ }
+ expect: {
+ var a_p = 42;
+ console.log(function() {
+ ({});
+ }());
+ }
+ expect_stdout: "undefined"
+}