@@ -4774,9 +4774,11 @@ merge(Compressor.prototype, {
|
||||
node.definitions.forEach(function(defn) {
|
||||
var def = defn.name.definition();
|
||||
var_defs_by_id.add(def.id, defn);
|
||||
if (node instanceof AST_Var && def.orig[0] instanceof AST_SymbolCatch) {
|
||||
var redef = def.redefined();
|
||||
if (redef && node instanceof AST_Var) var_defs_by_id.add(redef.id, defn);
|
||||
if ((!drop_vars || (node instanceof AST_Const ? redef : def.const_redefs))
|
||||
if (redef) var_defs_by_id.add(redef.id, defn);
|
||||
}
|
||||
if ((!drop_vars || (node instanceof AST_Const ? def.redefined() : def.const_redefs))
|
||||
&& !(def.id in in_use_ids)) {
|
||||
in_use_ids[def.id] = true;
|
||||
in_use.push(def);
|
||||
|
||||
@@ -3085,3 +3085,30 @@ issue_4184: {
|
||||
}
|
||||
expect_stdout: "42"
|
||||
}
|
||||
|
||||
issue_4235: {
|
||||
options = {
|
||||
inline: true,
|
||||
reduce_vars: true,
|
||||
unused: true,
|
||||
varify: true,
|
||||
}
|
||||
input: {
|
||||
(function() {
|
||||
{
|
||||
const f = 0;
|
||||
}
|
||||
(function f() {
|
||||
var f = console.log(f);
|
||||
})();
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function() {
|
||||
f = console.log(f),
|
||||
void 0;
|
||||
var f;
|
||||
})();
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
@@ -2859,3 +2859,21 @@ issue_4186: {
|
||||
}
|
||||
expect_stdout: "NaN"
|
||||
}
|
||||
|
||||
issue_4235: {
|
||||
options = {
|
||||
ie8: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
try {} catch (e) {}
|
||||
console.log(function e() {
|
||||
var e = 0;
|
||||
}());
|
||||
}
|
||||
expect: {
|
||||
try {} catch (e) {}
|
||||
console.log(function e() {}());
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user