@@ -5276,8 +5276,13 @@ merge(Compressor.prototype, {
|
||||
return true;
|
||||
}
|
||||
if (node instanceof AST_VarDef) {
|
||||
if (node.value) node.value.walk(tw);
|
||||
node.name.mark_symbol(node.value ? function(node) {
|
||||
var assigned = node.value;
|
||||
if (assigned) {
|
||||
assigned.walk(tw);
|
||||
} else {
|
||||
assigned = segment.block instanceof AST_ForEnumeration && segment.block.init === tw.parent();
|
||||
}
|
||||
node.name.mark_symbol(assigned ? function(node) {
|
||||
if (!(node instanceof AST_SymbolDeclaration)) return;
|
||||
if (node instanceof AST_SymbolVar) {
|
||||
mark(node);
|
||||
|
||||
@@ -3183,3 +3183,32 @@ issue_4257: {
|
||||
"1",
|
||||
]
|
||||
}
|
||||
|
||||
issue_4628: {
|
||||
options = {
|
||||
merge_vars: true,
|
||||
}
|
||||
input: {
|
||||
(function() {
|
||||
try {
|
||||
console;
|
||||
} finally {
|
||||
var b = a;
|
||||
}
|
||||
for (var a in "foo");
|
||||
console.log(b);
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function() {
|
||||
try {
|
||||
console;
|
||||
} finally {
|
||||
var b = a;
|
||||
}
|
||||
for (var a in "foo");
|
||||
console.log(b);
|
||||
})();
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user