From: Mihai Bazon Date: Mon, 16 Nov 2015 10:06:12 +0000 (+0200) Subject: Limit max iterations for tighten_body X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b6968b6bd2a740281e03e804ae68b3f5e63ce5ed;p=UglifyJS.git Limit max iterations for tighten_body Ref #866 --- 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);