@@ -3716,12 +3716,8 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
|
||||
function extract_declarations_from_unreachable_code(compressor, stat, target) {
|
||||
if (!(stat instanceof AST_DefClass
|
||||
|| stat instanceof AST_Definitions
|
||||
|| stat instanceof AST_LambdaDefinition)) {
|
||||
AST_Node.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
||||
}
|
||||
var block;
|
||||
var dropped = false;
|
||||
stat.walk(new TreeWalker(function(node, descend) {
|
||||
if (node instanceof AST_DefClass) {
|
||||
node.extends = null;
|
||||
@@ -3750,16 +3746,17 @@ merge(Compressor.prototype, {
|
||||
block = [];
|
||||
descend();
|
||||
if (block.required) {
|
||||
target.push(make_node(AST_BlockStatement, stat, {
|
||||
body: block
|
||||
}));
|
||||
target.push(make_node(AST_BlockStatement, stat, { body: block }));
|
||||
} else if (block.length) {
|
||||
[].push.apply(target, block);
|
||||
}
|
||||
block = save;
|
||||
return true;
|
||||
}
|
||||
if (!(node instanceof AST_LoopControl)) dropped = true;
|
||||
}));
|
||||
if (dropped) AST_Node.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
|
||||
|
||||
function push(node) {
|
||||
if (block) {
|
||||
block.push(node);
|
||||
@@ -6709,7 +6706,7 @@ merge(Compressor.prototype, {
|
||||
if (tail.length == 0) break;
|
||||
if (tail.length == duplicated) {
|
||||
[].unshift.apply(side_effects, tail.map(function(def) {
|
||||
AST_Node.warn("Dropping duplicated definition of variable {name} [{file}:{line},{col}]", template(def.name));
|
||||
AST_Node.info("Dropping duplicated definition of variable {name} [{file}:{line},{col}]", template(def.name));
|
||||
var sym = def.name.definition();
|
||||
var ref = make_node(AST_SymbolRef, def.name, def.name);
|
||||
sym.references.push(ref);
|
||||
|
||||
Reference in New Issue
Block a user