diff options
author | Mihai Bazon <mihai.bazon@gmail.com> | 2015-11-16 12:06:12 +0200 |
---|---|---|
committer | Mihai Bazon <mihai.bazon@gmail.com> | 2015-11-16 12:08:24 +0200 |
commit | b6968b6bd2a740281e03e804ae68b3f5e63ce5ed (patch) | |
tree | 4c36338aa9502eeb1c8c17f946f53954d3a3bee9 /lib/compress.js | |
parent | 08b80302eb28a1433d79b2e4ee40506eb6f390c7 (diff) | |
download | tracifyjs-b6968b6bd2a740281e03e804ae68b3f5e63ce5ed.tar.gz tracifyjs-b6968b6bd2a740281e03e804ae68b3f5e63ce5ed.zip |
Limit max iterations for tighten_body
Ref #866
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index 3efca411..c384e997 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -199,7 +199,7 @@ merge(Compressor.prototype, { }; function tighten_body(statements, compressor) { - var CHANGED; + var CHANGED, max_iter = 10; do { CHANGED = false; if (compressor.option("angular")) { @@ -218,7 +218,7 @@ merge(Compressor.prototype, { if (compressor.option("join_vars")) { statements = join_consecutive_vars(statements, compressor); } - } while (CHANGED); + } while (CHANGED && max_iter-- > 0); if (compressor.option("negate_iife")) { negate_iifes(statements, compressor); |