aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-21 22:04:28 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-21 22:04:28 -0800
commitd85a66e494512af061f359a575c6be46b68e7e9d (patch)
tree62951a1fd04cc0fbba6822956a0b419a853a3979 /tools/js-optimizer.js
parentb787b69400f66ee21f2e0acd2691d25751b7e746 (diff)
fix hoistMultiples bug
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index a4bb896a..c4de51e3 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -365,7 +365,7 @@ function simplifyExpressionsPost(ast) {
function hoistMultiples(ast) {
ast[1].forEach(function(node, i) {
var type = node[0];
- if (type == 'defun') {
+ if (type == 'defun' && isGenerated(node[1])) {
var statements = node[3];
for (var i = 0; i < statements.length-1; i++) {
var modified = false;
@@ -435,7 +435,7 @@ function hoistMultiples(ast) {
more = false;
ast[1].forEach(function(node, i) {
var type = node[0];
- if (type == 'defun') {
+ if (type == 'defun' && isGenerated(node[1])) {
traverse(node, function(node, type) {
if (type == 'if' && node[2][0] == 'block' && node[2][1].length == 0) {
more = true;