@@ -2051,7 +2051,7 @@ Compressor.prototype.compress = function(node) {
|
||||
if (node instanceof AST_BlockScope
|
||||
&& !(node instanceof AST_Scope)
|
||||
&& !(node.variables && node.variables.all(function(def) {
|
||||
return !lvalues.has(def.name);
|
||||
return !enclosed.has(def.name) && !lvalues.has(def.name);
|
||||
}))) {
|
||||
var replace = can_replace;
|
||||
can_replace = false;
|
||||
@@ -2149,6 +2149,7 @@ Compressor.prototype.compress = function(node) {
|
||||
var read_toplevel = false;
|
||||
var modify_toplevel = false;
|
||||
// Locate symbols which may execute code outside of scanning range
|
||||
var enclosed = new Dictionary();
|
||||
var well_defined = true;
|
||||
var lvalues = get_lvalues(candidate);
|
||||
var lhs_local = is_lhs_local(lhs);
|
||||
@@ -3010,6 +3011,9 @@ Compressor.prototype.compress = function(node) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
node.enclosed.forEach(function(def) {
|
||||
if (def.scope !== node) enclosed.set(def.name, true);
|
||||
});
|
||||
return true;
|
||||
} else if (find_arguments && node instanceof AST_Sub) {
|
||||
scope.each_argname(function(argname) {
|
||||
|
||||
Reference in New Issue
Block a user