[Pkg-javascript-commits] [uglifyjs] 121/190: #877 Ignore mangle sort option

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:19 UTC 2016


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

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit 102d1b9137353086f11fe2fc7abf9095042d4306
Author: kzc <zaxxon2011 at gmail.com>
Date:   Sat Feb 27 15:33:10 2016 -0500

    #877 Ignore mangle sort option
---
 README.md    | 5 -----
 lib/scope.js | 5 +----
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 4012b75..9255901 100644
--- a/README.md
+++ b/README.md
@@ -192,11 +192,6 @@ input files from the command line.
 To enable the mangler you need to pass `--mangle` (`-m`).  The following
 (comma-separated) options are supported:
 
-- `sort` — to assign shorter names to most frequently used variables.  This
-  saves a few hundred bytes on jQuery before gzip, but the output is
-  _bigger_ after gzip (and seems to happen for other libraries I tried it
-  on) therefore it's not enabled by default.
-
 - `toplevel` — mangle names declared in the toplevel scope (disabled by
   default).
 
diff --git a/lib/scope.js b/lib/scope.js
index ace2589..5ab775a 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -372,7 +372,7 @@ AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
     return defaults(options, {
         except      : [],
         eval        : false,
-        sort        : false,
+        sort        : false, // Ignored. Flag retained for backwards compatibility.
         toplevel    : false,
         screw_ie8   : false,
         keep_fnames : false
@@ -415,9 +415,6 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options){
                     a.push(symbol);
                 }
             });
-            if (options.sort) a.sort(function(a, b){
-                return b.references.length - a.references.length;
-            });
             to_mangle.push.apply(to_mangle, a);
             return;
         }

-- 
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