[Pkg-javascript-commits] [uglifyjs] 30/77: aborts(AST_If) returns the `if` node

Jonas Smedegaard dr at jones.dk
Tue May 19 00:02:29 UTC 2015


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

js pushed a commit to tag v2.4.18
in repository uglifyjs.

commit d2d716483aa69927541a0a29f3c1ee3c7bba30b4
Author: Mihai Bazon <mihai at bazon.net>
Date:   Tue Jan 6 13:57:18 2015 +0200

    aborts(AST_If) returns the `if` node
    
    Previously it returned the abort node from the alternative branch.  This is
    not much use as it can be different from the one in the body
    branch (i.e. return vs. throw) and can trick us into issues like #591.
    
    Fix #591
---
 lib/compress.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/compress.js b/lib/compress.js
index 345d8ad..83c3e6d 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -950,7 +950,7 @@ merge(Compressor.prototype, {
         def(AST_BlockStatement, block_aborts);
         def(AST_SwitchBranch, block_aborts);
         def(AST_If, function(){
-            return this.alternative && aborts(this.body) && aborts(this.alternative);
+            return this.alternative && aborts(this.body) && aborts(this.alternative) && this;
         });
     })(function(node, func){
         node.DEFMETHOD("aborts", func);

-- 
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