diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-05-25 16:05:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-05-25 16:05:17 -0700 |
commit | 7011aa3831041920d5269d873b0c16acaa042360 (patch) | |
tree | 69d9182003df77fa329c0ff6e6cb628cbc3effd8 /tools/js-optimizer.js | |
parent | 83bd24902870514c2abcc3a9aa5261c85b7d1fb7 (diff) |
registerize in asm switches
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 4b0938c2..a52ad6b7 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1505,7 +1505,7 @@ function registerize(ast) { // Replace all var definitions with assignments; we will add var definitions at the top after we registerize // We also mark local variables - i.e., having a var definition var localVars = {}; - var hasSwitch = false; // we cannot optimize variables if there is a switch + var hasSwitch = false; // we cannot optimize variables if there is a switch, unless in asm mode traverse(fun, function(node, type) { if (type == 'var') { node[1].forEach(function(defined) { localVars[defined[0]] = 1 }); @@ -1630,7 +1630,7 @@ function registerize(ast) { } }); var optimizables = {}; - if (!hasSwitch) { + if (!hasSwitch || asm) { for (var possible in possibles) { if (!unoptimizables[possible]) optimizables[possible] = 1; } |