aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/conditionals.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index 7c81cc80..c5639836 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -893,3 +893,43 @@ equality_conditionals_true: {
}
expect_stdout: true
}
+
+issue_1645_1: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ var a = 100, b = 10;
+ (b = a) ? a++ + (b += a) ? b += a : b += a : b ^= a;
+ console.log(a, b);
+ }
+ expect: {
+ var a = 100, b = 10;
+ (b = a) ? (a++ + (b += a), b += a) : b ^= a;
+ console.log(a,b);
+ }
+ expect_stdout: true
+}
+
+issue_1645_2: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ var a = 0;
+ function f() {
+ return a++;
+ }
+ f() ? a += 2 : a += 4;
+ console.log(a);
+ }
+ expect: {
+ var a = 0;
+ function f(){
+ return a++;
+ }
+ f() ? a += 2 : a += 4;
+ console.log(a);
+ }
+ expect_stdout: true
+}