diff options
author | Ryan Kelly <ryan@rfk.id.au> | 2014-01-16 16:19:22 +1100 |
---|---|---|
committer | Ryan Kelly <ryan@rfk.id.au> | 2014-01-16 16:19:22 +1100 |
commit | 375761d4a5f514f7de05efb134037bd6a6923831 (patch) | |
tree | 2da0a803d66caf0f4e157b5d1b43cfc78745fa01 /tools | |
parent | ba54ecbc9321c49f119b7e013559cee1b8a8afb7 (diff) |
Address review comments.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/js-optimizer.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 7130faa4..5f0e17a5 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1838,7 +1838,7 @@ function registerize(ast) { regTypes[ret] = type; } if (ret in allVars) { - assert(ret in localVars, 'register shadows non-local name: ' + ret); + assert(ret in localVars, 'register shadows non-local name'); } return ret; } @@ -2867,6 +2867,7 @@ function minifyLocals(ast) { while (1) { ensureMinifiedNames(nextMinifiedName); minified = minifiedNames[nextMinifiedName++]; + // TODO: we can probably remove !isLocalName here if (!usedNames[minified] && !isLocalName(minified)) { return minified; } @@ -2877,7 +2878,7 @@ function minifyLocals(ast) { assert(fun[1]); } if (fun[2]) { - for (var i=0; i<fun[2].length; i++) { + for (var i = 0; i < fun[2].length; i++) { var minified = getNextMinifiedName(); newNames[fun[2][i]] = minified; fun[2][i] = minified; @@ -2900,7 +2901,7 @@ function minifyLocals(ast) { if (!(name in newNames)) { newNames[name] = getNextMinifiedName(); } - defn[0] = newNames[name] + defn[0] = newNames[name]; }); } }); |