(node, in_list)
| 2090 | // https://github.com/mishoo/UglifyJS/issues/3371 |
| 2091 | // We fix it at this stage by moving the `var` outside the `for`. |
| 2092 | function patch_for_init(node, in_list) { |
| 2093 | var block; |
| 2094 | if (node.init instanceof AST_BlockStatement) { |
| 2095 | block = node.init; |
| 2096 | node.init = block.body.pop(); |
| 2097 | block.body.push(node); |
| 2098 | } |
| 2099 | if (node.init instanceof AST_Defun) { |
| 2100 | if (!block) block = make_node(AST_BlockStatement, node, { body: [ node ] }); |
| 2101 | block.body.splice(-1, 0, node.init); |
| 2102 | node.init = null; |
| 2103 | } else if (node.init instanceof AST_SimpleStatement) { |
| 2104 | node.init = node.init.body; |
| 2105 | } else if (is_empty(node.init)) { |
| 2106 | node.init = null; |
| 2107 | } |
| 2108 | if (!block) return; |
| 2109 | return in_list ? List.splice(block.body) : block; |
| 2110 | } |
| 2111 | |
| 2112 | function tighten_body(statements, compressor) { |
| 2113 | var in_lambda = last_of(compressor, function(node) { |
no test coverage detected
searching dependent graphs…