| | |
| | | AST_Unary, |
| | | AST_UnaryPostfix, |
| | | AST_UnaryPrefix, |
| | | AST_Undefined, |
| | | AST_Using, |
| | | AST_Var, |
| | | AST_VarDef, |
| | |
| | | } from "../ast.js"; |
| | | import { |
| | | make_node, |
| | | make_void_0, |
| | | MAP, |
| | | member, |
| | | remove, |
| | |
| | | } |
| | | } else { |
| | | if (!arg) { |
| | | arg = make_node(AST_Undefined, sym).transform(compressor); |
| | | arg = make_void_0(sym).transform(compressor); |
| | | } else if (arg instanceof AST_Lambda && arg.pinned() |
| | | || has_overlapping_symbol(fn, arg, fn_strict)) { |
| | | arg = null; |
| | |
| | | found = true; |
| | | if (node instanceof AST_VarDef) { |
| | | node.value = node.name instanceof AST_SymbolConst |
| | | ? make_node(AST_Undefined, node.value) // `const` always needs value. |
| | | ? make_void_0(node.value) // `const` always needs value. |
| | | : null; |
| | | return node; |
| | | } |
| | |
| | | var stat = statements[i]; |
| | | if (prev) { |
| | | if (stat instanceof AST_Exit) { |
| | | stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor)); |
| | | stat.value = cons_seq(stat.value || make_void_0(stat).transform(compressor)); |
| | | } else if (stat instanceof AST_For) { |
| | | if (!(stat.init instanceof AST_DefinitionsLike)) { |
| | | const abort = walk(prev.body, node => { |