diff options
author | kzc <zaxxon2011@gmail.com> | 2016-06-26 17:16:02 -0400 |
---|---|---|
committer | Richard van Velzen <rvanvelzen@experty.com> | 2016-07-01 09:41:31 +0200 |
commit | b7ef7840f3f0ab2bec09bec4d4b8a8bb8d50dc78 (patch) | |
tree | dae98aedf3c4538f7f57d0acdeab6aa71675d068 /lib | |
parent | 85924bb32e1c27f555aad1651f4575b45bcbadb1 (diff) | |
download | tracifyjs-b7ef7840f3f0ab2bec09bec4d4b8a8bb8d50dc78.tar.gz tracifyjs-b7ef7840f3f0ab2bec09bec4d4b8a8bb8d50dc78.zip |
Allow sequences maximum length to be user configurable.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index 22d6bf17..6a534c3a 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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(); |