From: Mihai Bazon Date: Wed, 17 Oct 2012 12:24:47 +0000 (+0300) Subject: the `sort` option is broken anyway, removed it X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8f664585983e4174bb850e3975659127eb99df36;p=UglifyJS.git the `sort` option is broken anyway, removed it we need to mangle names from outermost to innermost scope; mangling names from inner scopes before we got to the outer scope won't work correctly, therefore sorting doesn't make sense. --- diff --git a/lib/scope.js b/lib/scope.js index eebedfd8..d87a54d8 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -329,7 +329,6 @@ AST_Symbol.DEFMETHOD("global", function(){ AST_Toplevel.DEFMETHOD("mangle_names", function(options){ options = defaults(options, { - sort : false, except : [] }); // We only need to mangle declaration nodes. Special logic wired @@ -368,11 +367,6 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options){ } }); this.walk(tw); - - if (options.sort) to_mangle = mergeSort(to_mangle, function(a, b){ - return b.references.length - a.references.length; - }); - to_mangle.forEach(function(def){ def.mangle(options) }); });