return self;
});
- function is_reachable(node, defs) {
+ function is_reachable(self, defs) {
var reachable = false;
var find_ref = new TreeWalker(function(node) {
if (reachable) return true;
});
var scan_scope = new TreeWalker(function(node) {
if (reachable) return true;
- if (node instanceof AST_Scope) {
+ if (node instanceof AST_Scope && node !== self) {
var parent = scan_scope.parent();
if (!(parent instanceof AST_Call && parent.expression === node)) {
node.walk(find_ref);
return true;
}
});
- node.walk(scan_scope);
+ self.walk(scan_scope);
return reachable;
}
parent = compressor.parent(level++);
if (parent instanceof AST_Exit) {
if (in_try(level, parent instanceof AST_Throw)) break;
- if (is_reachable(self, [ def ])) break;
+ if (is_reachable(def.scope, [ def ])) break;
if (self.operator == "=") return self.right;
return make_node(AST_Binary, self, {
operator: self.operator.slice(0, -1),