Allow sequences maximum length to be user configurable.
This commit is contained in:
@@ -79,6 +79,8 @@ function Compressor(options, false_by_default) {
|
||||
global_defs : {},
|
||||
passes : 1,
|
||||
}, true);
|
||||
var sequences = this.options["sequences"];
|
||||
this.sequences_limit = sequences == 1 ? 2000 : sequences | 0;
|
||||
this.warnings_produced = {};
|
||||
};
|
||||
|
||||
@@ -266,7 +268,7 @@ merge(Compressor.prototype, {
|
||||
if (compressor.option("if_return")) {
|
||||
statements = handle_if_return(statements, compressor);
|
||||
}
|
||||
if (compressor.option("sequences")) {
|
||||
if (compressor.sequences_limit > 0) {
|
||||
statements = sequencesize(statements, compressor);
|
||||
}
|
||||
if (compressor.option("join_vars")) {
|
||||
@@ -721,7 +723,7 @@ merge(Compressor.prototype, {
|
||||
seq = [];
|
||||
};
|
||||
statements.forEach(function(stat){
|
||||
if (stat instanceof AST_SimpleStatement && seqLength(seq) < 2000) {
|
||||
if (stat instanceof AST_SimpleStatement && seqLength(seq) < compressor.sequences_limit) {
|
||||
seq.push(stat.body);
|
||||
} else {
|
||||
push_seq();
|
||||
|
||||
Reference in New Issue
Block a user