aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2015-11-16 12:06:12 +0200
committerMihai Bazon <mihai.bazon@gmail.com>2015-11-16 12:08:24 +0200
commitb6968b6bd2a740281e03e804ae68b3f5e63ce5ed (patch)
tree4c36338aa9502eeb1c8c17f946f53954d3a3bee9
parent08b80302eb28a1433d79b2e4ee40506eb6f390c7 (diff)
downloadtracifyjs-b6968b6bd2a740281e03e804ae68b3f5e63ce5ed.tar.gz
tracifyjs-b6968b6bd2a740281e03e804ae68b3f5e63ce5ed.zip
Limit max iterations for tighten_body
Ref #866
-rw-r--r--lib/compress.js4
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);