-c sequences=N suboptimal at N expression cutoff

N = 2:
  a;
  b;
  c;
  d;
was:
  a, b;
  c;
  d;
now:
  a, b;
  c, d;

fixes #1455
closes #1457
This commit is contained in:
alexlamsl
2017-02-18 19:07:03 +08:00
parent ae4db00991
commit f584ca8d07
2 changed files with 48 additions and 1 deletions

View File

@@ -749,7 +749,10 @@ merge(Compressor.prototype, {
seq = [];
};
statements.forEach(function(stat){
if (stat instanceof AST_SimpleStatement && seqLength(seq) < compressor.sequences_limit) {
if (stat instanceof AST_SimpleStatement) {
if (seqLength(seq) >= compressor.sequences_limit) {
push_seq();
}
seq.push(stat.body);
} else {
push_seq();