removed the "squeeze" method (it's now effectively "transform")
This commit is contained in:
@@ -132,7 +132,7 @@ if (SCOPE_IS_NEEDED) {
|
|||||||
if (ARGS.c !== true) {
|
if (ARGS.c !== true) {
|
||||||
time_it("squeeze", function(){
|
time_it("squeeze", function(){
|
||||||
var compressor = UglifyJS.Compressor(COMPRESSOR_OPTIONS);
|
var compressor = UglifyJS.Compressor(COMPRESSOR_OPTIONS);
|
||||||
TOPLEVEL = TOPLEVEL.squeeze(compressor);
|
TOPLEVEL = TOPLEVEL.transform(compressor);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ merge(Compressor.prototype, {
|
|||||||
CHANGED = true;
|
CHANGED = true;
|
||||||
stat = stat.clone();
|
stat = stat.clone();
|
||||||
stat.alternative = ret[0];
|
stat.alternative = ret[0];
|
||||||
ret[0] = stat.squeeze(compressor);
|
ret[0] = stat.transform(compressor);
|
||||||
continue loop;
|
continue loop;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
@@ -225,7 +225,7 @@ merge(Compressor.prototype, {
|
|||||||
stat.alternative = ret[0] || make_node(AST_Return, stat, {
|
stat.alternative = ret[0] || make_node(AST_Return, stat, {
|
||||||
value: make_node(AST_Undefined, stat)
|
value: make_node(AST_Undefined, stat)
|
||||||
});
|
});
|
||||||
ret[0] = stat.squeeze(compressor);
|
ret[0] = stat.transform(compressor);
|
||||||
continue loop;
|
continue loop;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
@@ -238,7 +238,7 @@ merge(Compressor.prototype, {
|
|||||||
body: as_statement_array(stat.alternative).concat(ret)
|
body: as_statement_array(stat.alternative).concat(ret)
|
||||||
});
|
});
|
||||||
stat.alternative = null;
|
stat.alternative = null;
|
||||||
ret = [ stat.squeeze(compressor) ];
|
ret = [ stat.transform(compressor) ];
|
||||||
continue loop;
|
continue loop;
|
||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
@@ -247,7 +247,7 @@ merge(Compressor.prototype, {
|
|||||||
CHANGED = true;
|
CHANGED = true;
|
||||||
ret.push(make_node(AST_Return, ret[0], {
|
ret.push(make_node(AST_Return, ret[0], {
|
||||||
value: make_node(AST_Undefined, ret[0])
|
value: make_node(AST_Undefined, ret[0])
|
||||||
}).squeeze(compressor));
|
}).transform(compressor));
|
||||||
ret = as_statement_array(stat.alternative).concat(ret);
|
ret = as_statement_array(stat.alternative).concat(ret);
|
||||||
ret.unshift(stat);
|
ret.unshift(stat);
|
||||||
continue loop;
|
continue loop;
|
||||||
@@ -267,7 +267,7 @@ merge(Compressor.prototype, {
|
|||||||
stat.alternative = make_node(AST_BlockStatement, stat, {
|
stat.alternative = make_node(AST_BlockStatement, stat, {
|
||||||
body: body
|
body: body
|
||||||
});
|
});
|
||||||
ret = [ stat.squeeze(compressor) ];
|
ret = [ stat.transform(compressor) ];
|
||||||
continue loop;
|
continue loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ merge(Compressor.prototype, {
|
|||||||
stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
|
stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
|
||||||
body: as_statement_array(stat.alternative).slice(0, -1)
|
body: as_statement_array(stat.alternative).slice(0, -1)
|
||||||
});
|
});
|
||||||
ret = [ stat.squeeze(compressor) ];
|
ret = [ stat.transform(compressor) ];
|
||||||
continue loop;
|
continue loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1543,10 +1543,4 @@ merge(Compressor.prototype, {
|
|||||||
return self;
|
return self;
|
||||||
});
|
});
|
||||||
|
|
||||||
/* -----[ node squeezers ]----- */
|
|
||||||
|
|
||||||
AST_Node.DEFMETHOD("squeeze", function(compressor){
|
|
||||||
return this.transform(compressor);
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function run_compress_tests() {
|
|||||||
var cmp = new U.Compressor(test.options || {}, true);
|
var cmp = new U.Compressor(test.options || {}, true);
|
||||||
var expect = make_code(as_toplevel(test.expect), false);
|
var expect = make_code(as_toplevel(test.expect), false);
|
||||||
var input = as_toplevel(test.input);
|
var input = as_toplevel(test.input);
|
||||||
var output = input.squeeze(cmp);
|
var output = input.transform(cmp);
|
||||||
output.figure_out_scope();
|
output.figure_out_scope();
|
||||||
output = make_code(output, false);
|
output = make_code(output, false);
|
||||||
if (expect != output) {
|
if (expect != output) {
|
||||||
|
|||||||
Reference in New Issue
Block a user