aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/functions.js170
-rw-r--r--test/compress/ie8.js4
2 files changed, 172 insertions, 2 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index a9a3b8f6..5713a37b 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -6013,7 +6013,7 @@ issue_4823: {
console.log(typeof function() {
{
function f() {}
- arguments = f();
+ f();
var arguments = function() {};
}
return f && arguments;
@@ -6040,3 +6040,171 @@ drop_unused_self_reference: {
}
expect_stdout: "PASS"
}
+
+reduce_cross_reference_1: {
+ options = {
+ passes: 3,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function(a, b) {
+ a = b = function() {};
+ a.p = a;
+ b = a = function() {};
+ b.q = b;
+ })();
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_1_toplevel: {
+ options = {
+ passes: 2,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = b = function() {};
+ a.p = a;
+ var b = a = function() {};
+ b.q = b;
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_2: {
+ options = {
+ collapse_vars: true,
+ passes: 3,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function(a, b) {
+ a = b = function() {};
+ b.p = a;
+ b = a = function() {};
+ a.q = b;
+ })();
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_2_toplevel: {
+ options = {
+ collapse_vars: true,
+ passes: 2,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = b = function() {};
+ b.p = a;
+ var b = a = function() {};
+ a.q = b;
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_3: {
+ options = {
+ collapse_vars: true,
+ passes: 3,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function(a, b) {
+ a = b = function() {};
+ a.p = b;
+ b = a = function() {};
+ b.q = a;
+ })();
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_3_toplevel: {
+ options = {
+ collapse_vars: true,
+ passes: 2,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = b = function() {};
+ a.p = b;
+ var b = a = function() {};
+ b.q = a;
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_4: {
+ options = {
+ passes: 3,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ (function(a, b) {
+ a = b = function() {};
+ b.p = b;
+ b = a = function() {};
+ a.q = a;
+ })();
+ }
+ expect: {}
+ expect_stdout: true
+}
+
+reduce_cross_reference_4_toplevel: {
+ options = {
+ passes: 2,
+ pure_getters: "strict",
+ reduce_vars: true,
+ sequences: true,
+ side_effects: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = b = function() {};
+ b.p = b;
+ var b = a = function() {};
+ a.q = a;
+ }
+ expect: {}
+ expect_stdout: true
+}
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index a1daa59c..23532968 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -2653,7 +2653,9 @@ issue_4019: {
try {
console.log("FAIL");
} catch (o) {}
- }, o = (console.log(o.length), ++o);
+ };
+ console.log(o.length),
+ ++o;
}
expect_stdout: "0"
}