[Pkg-javascript-commits] [uglifyjs] 71/77: [sequencesize] Actually even better:

Jonas Smedegaard dr at jones.dk
Tue May 19 00:02:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag v2.4.18
in repository uglifyjs.

commit 5801fa39e9524e7b7a565a39c5efa12cdef3202f
Author: Mihai Bazon <mihai.bazon at gmail.com>
Date:   Sun Mar 22 13:01:42 2015 +0200

    [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
---
 lib/compress.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/compress.js b/lib/compress.js
index b50e7cf..a9e1da3 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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list