aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/pure_getters.js39
-rw-r--r--test/compress/reduce_vars.js19
2 files changed, 48 insertions, 10 deletions
diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js
index 338f8639..c2dcb95b 100644
--- a/test/compress/pure_getters.js
+++ b/test/compress/pure_getters.js
@@ -1,10 +1,9 @@
-side_effects: {
+strict: {
options = {
- pure_getters: true,
+ pure_getters: "strict",
reduce_vars: false,
side_effects: true,
toplevel: true,
- unsafe: false,
}
input: {
var a, b = null, c = {};
@@ -28,13 +27,12 @@ side_effects: {
}
}
-side_effects_reduce_vars: {
+strict_reduce_vars: {
options = {
- pure_getters: true,
+ pure_getters: "strict",
reduce_vars: true,
side_effects: true,
toplevel: true,
- unsafe: false,
}
input: {
var a, b = null, c = {};
@@ -57,13 +55,38 @@ side_effects_reduce_vars: {
}
}
-side_effects_unsafe: {
+unsafe: {
options = {
pure_getters: true,
reduce_vars: false,
side_effects: true,
toplevel: true,
- unsafe: true,
+ }
+ input: {
+ var a, b = null, c = {};
+ a.prop;
+ b.prop;
+ c.prop;
+ d.prop;
+ null.prop;
+ (void 0).prop;
+ undefined.prop;
+ }
+ expect: {
+ var a, b = null, c = {};
+ d;
+ null.prop;
+ (void 0).prop;
+ (void 0).prop;
+ }
+}
+
+unsafe_reduce_vars: {
+ options = {
+ pure_getters: true,
+ reduce_vars: true,
+ side_effects: true,
+ toplevel: true,
}
input: {
var a, b = null, c = {};
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 842d8de4..b6f711ad 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -1919,7 +1919,7 @@ side_effects_assign: {
pure_getters_1: {
options = {
- pure_getters: true,
+ pure_getters: "strict",
reduce_vars: true,
side_effects: true,
toplevel: true,
@@ -1941,7 +1941,7 @@ pure_getters_1: {
pure_getters_2: {
options = {
- pure_getters: true,
+ pure_getters: "strict",
reduce_vars: true,
toplevel: true,
unused: true,
@@ -1956,6 +1956,21 @@ pure_getters_2: {
}
}
+pure_getters_3: {
+ options = {
+ pure_getters: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a;
+ var a = a && a.b;
+ }
+ expect: {
+ }
+}
+
catch_var: {
options = {
booleans: true,