parent
44352eb26a
commit
2122a18124
|
|
@ -3315,7 +3315,18 @@ merge(Compressor.prototype, {
|
|||
});
|
||||
|
||||
AST_Definitions.DEFMETHOD("remove_initializers", function(){
|
||||
this.definitions.forEach(function(def){ def.value = null });
|
||||
var decls = [];
|
||||
this.definitions.forEach(function(def) {
|
||||
def.name.walk(new TreeWalker(function(node) {
|
||||
if (node instanceof AST_SymbolDeclaration) {
|
||||
decls.push(make_node(AST_VarDef, def, {
|
||||
name: node,
|
||||
value: null
|
||||
}));
|
||||
}
|
||||
}));
|
||||
});
|
||||
this.definitions = decls;
|
||||
});
|
||||
|
||||
AST_Definitions.DEFMETHOD("to_assignments", function(compressor){
|
||||
|
|
|
|||
|
|
@ -560,3 +560,19 @@ global_fns: {
|
|||
"RangeError",
|
||||
]
|
||||
}
|
||||
|
||||
issue_2383: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
dead_code: true,
|
||||
evaluate: true,
|
||||
}
|
||||
input: {
|
||||
if (0) {
|
||||
var {x, y} = foo();
|
||||
}
|
||||
}
|
||||
expect: {
|
||||
var x, y;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user