Skip to content

Commit

Permalink
#877 Ignore mangle sort option
Browse files Browse the repository at this point in the history
  • Loading branch information
kzc committed Feb 27, 2016
1 parent 294861b commit 102d1b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
5 changes: 1 addition & 4 deletions lib/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 102d1b9

Please sign in to comment.