aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2015-01-06 13:57:18 +0200
committerMihai Bazon <mihai@bazon.net>2015-01-06 14:01:35 +0200
commitd2d716483aa69927541a0a29f3c1ee3c7bba30b4 (patch)
tree7c6c4d28e9bc75dab452462f5306354f67c57f5b
parentf16033aafdd7f88da6b53c58f86b8effd1fb2a3d (diff)
downloadtracifyjs-d2d716483aa69927541a0a29f3c1ee3c7bba30b4.tar.gz
tracifyjs-d2d716483aa69927541a0a29f3c1ee3c7bba30b4.zip
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
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 345d8ad6..83c3e6d0 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);