diff options
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index c7fdf10f..047eeac2 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1363,6 +1363,8 @@ function registerize(ast) { }); } +var ELIMINATION_SAFE_NODES = set('var', 'assign', 'call', 'if'); + function eliminate(ast) { // Find variables that have a single use, and if they can be eliminated, do so traverseGeneratedFunctions(ast, function(func, type) { @@ -1545,7 +1547,7 @@ function eliminate(ast) { type = node[0]; } // Check for things that affect elimination - if (type == 'var' || type == 'assign' || type == 'call') { + if (type in ELIMINATION_SAFE_NODES) { // can we eliminate and/or track? if (!check(node)) continue; // try to eliminate |