From b6968b6bd2a740281e03e804ae68b3f5e63ce5ed Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Mon, 16 Nov 2015 12:06:12 +0200 Subject: Limit max iterations for tighten_body Ref #866 --- lib/compress.js | 4 ++-- 1 file 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); -- cgit v1.2.3