@@ -5279,7 +5279,8 @@ merge(Compressor.prototype, {
|
||||
});
|
||||
def(AST_SymbolRef, function(compressor) {
|
||||
if (!this.is_declared(compressor)) return this;
|
||||
this.definition().replaced++;
|
||||
var def = this.definition();
|
||||
if (member(this, def.references)) def.replaced++;
|
||||
return null;
|
||||
});
|
||||
def(AST_This, return_null);
|
||||
@@ -7575,9 +7576,8 @@ merge(Compressor.prototype, {
|
||||
function recursive_ref(compressor, def) {
|
||||
var level = 0, node = compressor.self();
|
||||
do {
|
||||
if (node instanceof AST_Lambda && node.name && node.name.definition() === def) break;
|
||||
if (node instanceof AST_Lambda && node.name && node.name.definition() === def) return node;
|
||||
} while (node = compressor.parent(level++));
|
||||
return node;
|
||||
}
|
||||
|
||||
OPT(AST_SymbolRef, function(self, compressor) {
|
||||
|
||||
@@ -297,3 +297,33 @@ operator_in: {
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
issue_3983: {
|
||||
options = {
|
||||
collapse_vars: true,
|
||||
conditionals: true,
|
||||
evaluate: true,
|
||||
inline: true,
|
||||
reduce_vars: true,
|
||||
side_effects: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var a = "PASS";
|
||||
function f() {
|
||||
g && g();
|
||||
}
|
||||
f();
|
||||
function g() {
|
||||
0 ? a : 0;
|
||||
}
|
||||
var b = a;
|
||||
console.log(a);
|
||||
}
|
||||
expect: {
|
||||
var a = "PASS";
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user