// certain combination of unused name + side effect leads to:
// https://github.com/mishoo/UglifyJS2/issues/44
// https://github.com/mishoo/UglifyJS2/issues/1830
+ // https://github.com/mishoo/UglifyJS2/issues/1838
// that's an invalid AST.
// We fix it at this stage by moving the `var` outside the `for`.
if (node instanceof AST_For) {
node.init = block.body.pop();
block.body.push(node);
return in_list ? MAP.splice(block.body) : block;
+ } else if (node.init instanceof AST_SimpleStatement) {
+ node.init = node.init.body;
} else if (is_empty(node.init)) {
node.init = null;
}