aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/conditionals.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index 7838fdbb..e37c5556 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -1224,3 +1224,46 @@ hoist_decl: {
x() ? y() : z();
}
}
+
+to_and_or: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ var values = [
+ 0,
+ null,
+ true,
+ "foo",
+ false,
+ -1 / 0,
+ void 0,
+ ];
+ values.forEach(function(x) {
+ values.forEach(function(y) {
+ values.forEach(function(z) {
+ console.log(x ? y || z : z);
+ });
+ });
+ });
+ }
+ expect: {
+ var values = [
+ 0,
+ null,
+ true,
+ "foo",
+ false,
+ -1 / 0,
+ void 0,
+ ];
+ values.forEach(function(x) {
+ values.forEach(function(y) {
+ values.forEach(function(z) {
+ console.log(x && y || z);
+ });
+ });
+ });
+ }
+ expect_stdout: true
+}