@@ -1942,6 +1942,7 @@ merge(Compressor.prototype, {
|
|||||||
var def = node.definition();
|
var def = node.definition();
|
||||||
return (in_try || def.scope.resolve() !== scope) && !can_drop_symbol(node);
|
return (in_try || def.scope.resolve() !== scope) && !can_drop_symbol(node);
|
||||||
}
|
}
|
||||||
|
if (node instanceof AST_Template) return node.tag && !is_raw_tag(compressor, node.tag);
|
||||||
if (node instanceof AST_This) return symbol_in_lvalues(node, parent);
|
if (node instanceof AST_This) return symbol_in_lvalues(node, parent);
|
||||||
if (node instanceof AST_VarDef) {
|
if (node instanceof AST_VarDef) {
|
||||||
if (check_destructured(node.name)) return true;
|
if (check_destructured(node.name)) return true;
|
||||||
|
|||||||
@@ -198,3 +198,27 @@ unsafe_side_effects: {
|
|||||||
expect_stdout: "foo"
|
expect_stdout: "foo"
|
||||||
node_version: ">=4"
|
node_version: ">=4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4604: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = 0, log = console.log;
|
||||||
|
a = "FAIL";
|
||||||
|
(function() {
|
||||||
|
a = "PASS";
|
||||||
|
})``;
|
||||||
|
log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = 0, log = console.log;
|
||||||
|
a = "FAIL";
|
||||||
|
(function() {
|
||||||
|
a = "PASS";
|
||||||
|
})``;
|
||||||
|
log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=4"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user