aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/collapse_vars.js31
-rw-r--r--test/compress/pure_funcs.js2
-rw-r--r--test/compress/side_effects.js23
3 files changed, 55 insertions, 1 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 0c232aa0..f99e0124 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -8164,3 +8164,34 @@ issue_3927: {
}
expect_stdout: "PASS"
}
+
+operator_in: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ function log(msg) {
+ console.log(msg);
+ }
+ var a = "FAIL";
+ try {
+ a = "PASS";
+ 0 in null;
+ log("FAIL", a);
+ } catch (e) {}
+ log(a);
+ }
+ expect: {
+ function log(msg) {
+ console.log(msg);
+ }
+ var a = "FAIL";
+ try {
+ a = "PASS";
+ 0 in null;
+ log("FAIL", a);
+ } catch (e) {}
+ log(a);
+ }
+ expect_stdout: "PASS"
+}
diff --git a/test/compress/pure_funcs.js b/test/compress/pure_funcs.js
index d65399f1..09f0bd45 100644
--- a/test/compress/pure_funcs.js
+++ b/test/compress/pure_funcs.js
@@ -136,7 +136,7 @@ relational: {
side_effects :true,
}
input: {
- foo() in foo();
+ foo() in new foo();
foo() instanceof bar();
foo() < "bar";
bar() > foo();
diff --git a/test/compress/side_effects.js b/test/compress/side_effects.js
index 63282660..b7ffe47a 100644
--- a/test/compress/side_effects.js
+++ b/test/compress/side_effects.js
@@ -274,3 +274,26 @@ drop_value: {
foo(), bar();
}
}
+
+operator_in: {
+ options = {
+ side_effects: true,
+ }
+ input: {
+ try {
+ "foo" in true;
+ console.log("FAIL");
+ } catch (e) {
+ console.log("PASS");
+ }
+ }
+ expect: {
+ try {
+ 0 in true;
+ console.log("FAIL");
+ } catch (e) {
+ console.log("PASS");
+ }
+ }
+ expect_stdout: "PASS"
+}