mark AST_Var out of block scopes (#2700)
This commit is contained in:
@@ -5032,10 +5032,8 @@ merge(Compressor.prototype, {
|
||||
var init;
|
||||
if (fixed instanceof AST_This) {
|
||||
if (!(d.orig[0] instanceof AST_SymbolFunarg)
|
||||
&& all(d.references, d.scope.is_block_scope() ? function(ref) {
|
||||
&& all(d.references, function(ref) {
|
||||
return d.scope === ref.scope;
|
||||
} : function(ref) {
|
||||
return d.scope === ref.scope.get_defun_scope();
|
||||
})) {
|
||||
init = fixed;
|
||||
}
|
||||
|
||||
@@ -284,6 +284,10 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
|
||||
}
|
||||
node.thedef = sym;
|
||||
node.reference(options);
|
||||
if (node.scope.is_block_scope()
|
||||
&& !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) {
|
||||
node.scope = node.scope.get_defun_scope();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// ensure mangling works if catch reuses a scope variable
|
||||
|
||||
Reference in New Issue
Block a user