@@ -1549,10 +1549,9 @@ merge(Compressor.prototype, {
|
||||
return lvalues.has(node.name.name) || side_effects && may_modify(node.name);
|
||||
}
|
||||
var sym = is_lhs(node.left, node);
|
||||
if (!sym) return false;
|
||||
return lvalues.has(sym.name)
|
||||
|| sym instanceof AST_PropAccess
|
||||
|| read_toplevel && compressor.exposed(sym.definition());
|
||||
if (sym instanceof AST_PropAccess) return true;
|
||||
if (!(sym instanceof AST_SymbolRef)) return false;
|
||||
return lvalues.has(sym.name) || read_toplevel && compressor.exposed(sym.definition());
|
||||
}
|
||||
|
||||
function extract_args() {
|
||||
|
||||
@@ -8375,3 +8375,19 @@ issue_4038: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_4040: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
toplevel: true,
|
||||
}
|
||||
input: {
|
||||
var a = console.log("PASS") && a.p;
|
||||
delete NaN;
|
||||
}
|
||||
expect: {
|
||||
var a = console.log("PASS") && a.p;
|
||||
delete NaN;
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user