[Pkg-javascript-commits] [uglifyjs] 69/190: Fix endless loop

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit 7f48d5b33cc2a130afead79cd09482cc833d17bb
Author: Mihai Bazon <mihai.bazon at gmail.com>
Date:   Mon Nov 16 12:07:15 2015 +0200

    Fix endless loop
    
    Close #866
---
 lib/compress.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/compress.js b/lib/compress.js
index c384e99..32833eb 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -384,7 +384,12 @@ merge(Compressor.prototype, {
                             continue loop;
                         }
                         //---
-                        if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
+                        // XXX: what was the intention of this case?
+                        // if sequences is not enabled, this can lead to an endless loop (issue #866).
+                        // however, with sequences on this helps producing slightly better output for
+                        // the example code.
+                        if (compressor.option("sequences")
+                            && ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
                             && (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
                             CHANGED = true;
                             ret.push(make_node(AST_Return, ret[0], {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list