`foo=bar`, or just `foo` (the latter implies a boolean option that you want
to set `true`; it's effectively a shortcut for `foo=true`).
-- `sequences` -- join consecutive simple statements using the comma operator
+- `sequences` (default: true) -- join consecutive simple statements using the
+ comma operator. May be set to a positive integer to specify the maximum number
+ of consecutive comma sequences that will be generated. If this option is set to
+ `true` then the default sequences limit is `2000`. Set option to `false` or `0`
+ to disable. On rare occasions the default sequences limit leads to very slow
+ compress times in which case a value of `20` or less is recommended.
- `properties` -- rewrite property access using the dot notation, for
example `foo["bar"] → foo.bar`
global_defs : {},
passes : 1,
}, true);
+ var sequences = this.options["sequences"];
+ this.sequences_limit = sequences == 1 ? 2000 : sequences | 0;
this.warnings_produced = {};
};
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")) {
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();