introduce functions (#3360)

`var f = function() {};` => `function f() {}`
This commit is contained in:
Alex Lam S.L
2019-04-15 22:23:11 +08:00
committed by GitHub
parent a57b069409
commit 5172ba5f2a
7 changed files with 268 additions and 46 deletions

View File

@@ -333,7 +333,7 @@ function next_mangled_name(scope, options, def) {
} while (scope = scope.parent_scope);
});
var name;
for (var i = 0, len = holes.length; i < len; i++) {
for (var i = 0; i < holes.length; i++) {
name = base54(holes[i]);
if (names[name]) continue;
holes.splice(i, 1);
@@ -555,7 +555,7 @@ var base54 = (function() {
var freq = Object.create(null);
function init(chars) {
var array = [];
for (var i = 0, len = chars.length; i < len; i++) {
for (var i = 0; i < chars.length; i++) {
var ch = chars[i];
array.push(ch);
freq[ch] = -1e-2 * i;