aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-10-27 10:14:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-10-27 10:14:48 -0700
commit9538f033eca496fd30af2b483414d051911f8812 (patch)
treeec30ff9a83fa1679faa5a408880e721a74608f28 /tools/js-optimizer.js
parentbecd49dbe7df7bb7b36bfebed75a097e436f88bd (diff)
add more aborting nodes in eliminator
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 3c905f4c..203db5bc 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -1369,7 +1369,7 @@ function registerize(ast) {
var ELIMINATION_SAFE_NODES = set('var', 'assign', 'call', 'if', 'toplevel');
var NODES_WITHOUT_ELIMINATION_SIDE_EFFECTS = set('name', 'num', 'string', 'binary', 'sub', 'unary-prefix');
var IGNORABLE_ELIMINATOR_SCAN_NODES = set('num', 'toplevel', 'string', 'break', 'continue', 'dot', 'return'); // dot can only be STRING_TABLE.*
-var ABORTING_ELIMINATOR_SCAN_NODES = set('new', 'object', 'function', 'defun', 'switch', 'for', 'while'); // we could handle some of these, TODO, but nontrivial (e.g. for while, the condition is hit multiple times after the body)
+var ABORTING_ELIMINATOR_SCAN_NODES = set('new', 'object', 'function', 'defun', 'switch', 'for', 'while', 'array', 'throw'); // we could handle some of these, TODO, but nontrivial (e.g. for while, the condition is hit multiple times after the body)
function eliminate(ast) {
// Find variables that have a single use, and if they can be eliminated, do so