defs = stat.init;
}
} else if (stat instanceof AST_ForIn) {
+ if (defs && defs.TYPE == stat.init.TYPE) {
+ defs.definitions = defs.definitions.concat(stat.init.definitions);
+ var name = stat.init.definitions[0].name;
+ var ref = make_node(AST_SymbolRef, name, name);
+ name.definition().references.push(ref);
+ stat.init = ref;
+ CHANGED = true;
+ }
stat.object = join_assigns_expr(stat.object);
} else if (stat instanceof AST_If) {
stat.condition = join_assigns_expr(stat.condition);
});
it("Should eliminate unreferenced labels", function() {
var result = reduce_test(read("test/input/reduce/label.js"), {
+ compress: {
+ unsafe_math: true,
+ },
mangle: false,
}, {
verbose: false,