parent
bdc8ef2218
commit
421bb7083a
|
|
@ -3916,14 +3916,18 @@ merge(Compressor.prototype, {
|
||||||
} else if (node instanceof AST_Unary) {
|
} else if (node instanceof AST_Unary) {
|
||||||
if (node.write_only) sym = node.expression;
|
if (node.write_only) sym = node.expression;
|
||||||
}
|
}
|
||||||
if (!/strict/.test(compressor.option("pure_getters"))) return sym instanceof AST_SymbolRef && sym;
|
if (/strict/.test(compressor.option("pure_getters"))) {
|
||||||
while (sym instanceof AST_PropAccess && !sym.expression.may_throw_on_access(compressor)) {
|
while (sym instanceof AST_PropAccess && !sym.expression.may_throw_on_access(compressor)) {
|
||||||
if (sym instanceof AST_Sub) props.unshift(sym.property);
|
if (sym instanceof AST_Sub) props.unshift(sym.property);
|
||||||
sym = sym.expression;
|
sym = sym.expression;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sym instanceof AST_SymbolRef && all(sym.definition().orig, function(sym) {
|
if (!(sym instanceof AST_SymbolRef)) return;
|
||||||
|
if (compressor.exposed(sym.definition())) return;
|
||||||
|
if (!all(sym.definition().orig, function(sym) {
|
||||||
return !(sym instanceof AST_SymbolLambda);
|
return !(sym instanceof AST_SymbolLambda);
|
||||||
}) && sym;
|
})) return;
|
||||||
|
return sym;
|
||||||
};
|
};
|
||||||
var in_use = [];
|
var in_use = [];
|
||||||
var in_use_ids = Object.create(null); // avoid expensive linear scans of in_use
|
var in_use_ids = Object.create(null); // avoid expensive linear scans of in_use
|
||||||
|
|
|
||||||
|
|
@ -2413,3 +2413,34 @@ issue_3673: {
|
||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_3746: {
|
||||||
|
options = {
|
||||||
|
keep_fargs: "strict",
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
try {
|
||||||
|
A;
|
||||||
|
} catch (e) {
|
||||||
|
var e;
|
||||||
|
}
|
||||||
|
(function f(a) {
|
||||||
|
e = a;
|
||||||
|
})();
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
try {
|
||||||
|
A;
|
||||||
|
} catch (e) {
|
||||||
|
var e;
|
||||||
|
}
|
||||||
|
(function(a) {
|
||||||
|
e = a;
|
||||||
|
})();
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user