aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-11-06 10:47:36 +0200
committerMihai Bazon <mihai@bazon.net>2013-11-06 10:48:48 +0200
commiteab99a1c3d229f7e73b91b5a28e5ebf53a24671b (patch)
tree655479057eaedbaee56ead75168ca98ecc7ff5f2 /test/compress
parent19e2fb134d1c6d0fdf74b0d008d772c0283afb6e (diff)
downloadtracifyjs-eab99a1c3d229f7e73b91b5a28e5ebf53a24671b.tar.gz
tracifyjs-eab99a1c3d229f7e73b91b5a28e5ebf53a24671b.zip
Better fix for #343
We can in fact lift sequences, but only if the operation is assignment and the left-hand side has no side effects nor property access -- that should guarantee that whatever we place before it cannot affect the sense of the assignment. Dropped contrived test case (too hard to support it now), added a more meaningful one.
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/sequences.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/compress/sequences.js b/test/compress/sequences.js
index 6f63ace4..46695714 100644
--- a/test/compress/sequences.js
+++ b/test/compress/sequences.js
@@ -101,10 +101,12 @@ lift_sequences_1: {
lift_sequences_2: {
options = { sequences: true, evaluate: true };
input: {
- q = 1 + (foo(), bar(), 5) + 7 * (5 / (3 - (a(), (QW=ER), c(), 2))) - (x(), y(), 5);
+ foo.x = (foo = {}, 10);
+ bar = (bar = {}, 10);
}
expect: {
- foo(), bar(), a(), QW = ER, c(), x(), y(), q = 36
+ foo.x = (foo = {}, 10),
+ bar = {}, bar = 10;
}
}