fix endless loop in tests

This commit is contained in:
Mihai Bazon
2012-10-03 12:49:47 +03:00
parent bd94eeb6f7
commit e0f5075e45

View File

@@ -325,9 +325,9 @@ merge(Compressor.prototype, {
function eliminate_dead_code(statements, compressor) {
var has_quit = false;
return statements.reduce(function(a, stat){
var orig = statements.length;
statements = statements.reduce(function(a, stat){
if (has_quit) {
CHANGED = true;
extract_declarations_from_unreachable_code(compressor, stat, a);
} else {
a.push(stat);
@@ -337,6 +337,8 @@ merge(Compressor.prototype, {
}
return a;
}, []);
CHANGED = statements.length != orig;
return statements;
};
function sequencesize(statements, compressor) {