diff options
author | alexlamsl <alexlamsl@gmail.com> | 2017-02-18 19:07:03 +0800 |
---|---|---|
committer | alexlamsl <alexlamsl@gmail.com> | 2017-02-21 13:29:57 +0800 |
commit | f584ca8d0766fb6d2a254dd4487afa91ed2c5034 (patch) | |
tree | ab4e021523e77f5d1a48369be5fe23b368244515 /lib/compress.js | |
parent | ae4db00991c6155fde42bd00c30614d922a4219a (diff) | |
download | tracifyjs-f584ca8d0766fb6d2a254dd4487afa91ed2c5034.tar.gz tracifyjs-f584ca8d0766fb6d2a254dd4487afa91ed2c5034.zip |
`-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
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index ee28ee14..e8b271f3 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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(); |