aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-03-22 13:01:42 +0200
committerMihai Bazon <mihai.bazon@gmail.com>2015-03-22 13:02:45 +0200
commit5801fa39e9524e7b7a565a39c5efa12cdef3202f (patch)
treea1c83219684b12833c66af2618f2d1602260e333
parentf0ab1b02e63bfad1162f77bb8545de34814f44f5 (diff)
downloadtracifyjs-5801fa39e9524e7b7a565a39c5efa12cdef3202f.tar.gz
tracifyjs-5801fa39e9524e7b7a565a39c5efa12cdef3202f.zip
[sequencesize] Actually even better:
do create the sequence even if the stat list is bigger than 2000 statements, but limit the sequence itself to 2000 expressions. Ref #414
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index b50e7cf0..a9e1da37 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -479,7 +479,7 @@ merge(Compressor.prototype, {
};
function sequencesize(statements, compressor) {
- if (statements.length < 2 || statements.length > 2000) return statements;
+ if (statements.length < 2) return statements;
var seq = [], ret = [];
function push_seq() {
seq = AST_Seq.from_array(seq);
@@ -489,7 +489,7 @@ merge(Compressor.prototype, {
seq = [];
};
statements.forEach(function(stat){
- if (stat instanceof AST_SimpleStatement) seq.push(stat.body);
+ if (stat instanceof AST_SimpleStatement && seq.length < 2000) seq.push(stat.body);
else push_seq(), ret.push(stat);
});
push_seq();