if (!default_branch) {
default_branch = branch;
} else {
- eliminate_branch(branch);
+ eliminate_branch(branch, body[body.length - 1]);
}
} else if (value !== self.expression) {
var exp = branch.expression.evaluate(compressor);
default_branch = null;
}
} else if (exp !== branch.expression) {
- eliminate_branch(branch);
+ eliminate_branch(branch, body[body.length - 1]);
continue;
}
}
}
body.push(branch);
}
- while (i < len) eliminate_branch(self.body[i++]);
+ while (i < len) eliminate_branch(self.body[i++], body[body.length - 1]);
if (body.length > 0) {
body[0].body = decl.concat(body[0].body);
}
return self;
function eliminate_branch(branch, prev) {
- if (!prev) prev = body[body.length - 1];
if (prev && !aborts(prev)) {
prev.body = prev.body.concat(branch.body);
} else {