aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2017-02-18 19:07:03 +0800
committeralexlamsl <alexlamsl@gmail.com>2017-02-21 13:29:57 +0800
commitf584ca8d0766fb6d2a254dd4487afa91ed2c5034 (patch)
treeab4e021523e77f5d1a48369be5fe23b368244515 /lib/compress.js
parentae4db00991c6155fde42bd00c30614d922a4219a (diff)
downloadtracifyjs-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.js5
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();