if (options.ie8 && sym instanceof AST_SymbolLambda)
s = s.parent_scope;
var def;
- if (this.defun && (def = this.defun.variables.get(this.name))) {
+ if (def = this.redefined()) {
this.mangled_name = def.mangled_name || def.name;
} else
this.mangled_name = s.next_mangled(options, this);
cache.set(this.name, this.mangled_name);
}
}
+ },
+ redefined: function() {
+ return this.defun && this.defun.variables.get(this.name);
}
};
node.reference(options);
return true;
}
+ // ensure mangling works if catch reuses a scope variable
+ var def;
+ if (node instanceof AST_SymbolCatch && (def = node.definition().redefined())) {
+ var s = node.scope;
+ while (s) {
+ push_uniq(s.enclosed, def);
+ if (s === def.scope) break;
+ s = s.parent_scope;
+ }
+ }
});
self.walk(tw);