aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-10-30 14:50:47 +0200
committerMihai Bazon <mihai@bazon.net>2012-10-30 14:50:47 +0200
commitabe0ebbf026bcf1ac280f160de8621071681b2b9 (patch)
tree7a916efe1969ac1ed37a1e53a0f0e0cbe12ab815 /test/compress
parent0852f5595edbceb1b8626c7214fcc6c17bf271e9 (diff)
downloadtracifyjs-abe0ebbf026bcf1ac280f160de8621071681b2b9.tar.gz
tracifyjs-abe0ebbf026bcf1ac280f160de8621071681b2b9.zip
don't move expressions containing the binary `in` operator into the `for` initializer
(opera can't parse it) close #25
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/sequences.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/sequences.js b/test/compress/sequences.js
index d48eced2..6f63ace4 100644
--- a/test/compress/sequences.js
+++ b/test/compress/sequences.js
@@ -127,3 +127,35 @@ lift_sequences_4: {
x = baz;
}
}
+
+for_sequences: {
+ options = { sequences: true };
+ input: {
+ // 1
+ foo();
+ bar();
+ for (; false;);
+ // 2
+ foo();
+ bar();
+ for (x = 5; false;);
+ // 3
+ x = (foo in bar);
+ for (; false;);
+ // 4
+ x = (foo in bar);
+ for (y = 5; false;);
+ }
+ expect: {
+ // 1
+ for (foo(), bar(); false;);
+ // 2
+ for (foo(), bar(), x = 5; false;);
+ // 3
+ x = (foo in bar);
+ for (; false;);
+ // 4
+ x = (foo in bar);
+ for (y = 5; false;);
+ }
+}