From 9c2238dad90372057bb243ea0ca88355f32f8d3f Mon Sep 17 00:00:00 2001 From: dom Date: Tue, 9 Jun 2015 09:23:00 +0800 Subject: [PATCH] Update scope.js fix the random output of base54 function.I haven't figure it out why,but the result array of string.split("") can be random in certain case. this will be a bug in mangling properties for multiple files. --- lib/scope.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/scope.js b/lib/scope.js index 6c19c19a..11a1acd7 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -480,7 +480,11 @@ var base54 = (function() { var chars, frequency; function reset() { frequency = Object.create(null); - chars = string.split("").map(function(ch){ return ch.charCodeAt(0) }); + var length = string.length; + chars = []; + for(var i=0;i