diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-25 14:42:25 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-25 14:42:25 -0700 |
commit | c5d2ef67e109d8dd18c6254dc31ba3a7149a0ccb (patch) | |
tree | ae903c8e86945f7d03fca86f9763cfe707ec276f /tools/js-optimizer.js | |
parent | 0b7976a1918b5aa8d0a6cb3a2a11bfa1a97786e9 (diff) |
fix handling of unremovable unused vars
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 8f472c3f..3a0ca529 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1424,9 +1424,10 @@ function eliminate(ast) { } else if (uses[name] == 0) { var mustRemain = false; if (values[name]) { - traverse(values[name], function(node, value) { + traverse(values[name], function(node, type) { if (!(type in NODES_WITHOUT_ELIMINATION_SIDE_EFFECTS)) { mustRemain = true; // cannot remove this unused variable, constructing it has side effects + return true; } }); } |