aboutsummaryrefslogtreecommitdiff
path: root/test/compress/sequences.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/sequences.js')
-rw-r--r--test/compress/sequences.js45
1 files changed, 44 insertions, 1 deletions
diff --git a/test/compress/sequences.js b/test/compress/sequences.js
index c0b77127..32db63d3 100644
--- a/test/compress/sequences.js
+++ b/test/compress/sequences.js
@@ -877,7 +877,7 @@ for_init_var: {
expect_stdout: "PASS"
}
-forin: {
+forin_1: {
options = {
sequences: true,
}
@@ -895,6 +895,49 @@ forin: {
expect_stdout: "PASS"
}
+forin_2: {
+ options = {
+ evaluate: true,
+ inline: true,
+ reduce_vars: true,
+ sequences: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var o = {
+ p: 1,
+ q: 2,
+ };
+ var k = "k";
+ for ((console.log("exp"), o)[function() {
+ console.log("prop");
+ return k;
+ }()] in function() {
+ console.log("obj");
+ return o;
+ }())
+ console.log(o.k, o[o.k]);
+ }
+ expect: {
+ var o = {
+ p: 1,
+ q: 2,
+ };
+ for ((console.log("exp"), o)[console.log("prop"), "k"] in console.log("obj"), o)
+ console.log(o.k, o[o.k]);
+ }
+ expect_stdout: [
+ "obj",
+ "exp",
+ "prop",
+ "p 1",
+ "exp",
+ "prop",
+ "q 2",
+ ]
+}
+
call: {
options = {
sequences: true,