Lines Matching full:if
39 THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 if (!(this instanceof Compressor))
118 if (typeof global_defs == "object") for (var key in global_defs) {
119 if (/^@/.test(key) && HOP(global_defs, key)) {
123 if (this.options["inline"] === true) this.options["inline"] = 4;
125 if (lambda.length_read) return false;
127 if (!name) return parent && parent.TYPE == "Call" && parent.expression === lambda;
128 if (name.fixed_value() !== lambda) return false;
130 if (def.direct_access) return false;
134 if (this.options["module"]) this.directives["use strict"] = true;
136 if (typeof pure_funcs == "function") {
138 } else if (typeof pure_funcs == "string") {
141 if (node instanceof AST_Call) {
143 } else if (node instanceof AST_Template) {
148 } else if (Array.isArray(pure_funcs)) {
151 if (node instanceof AST_Call) {
153 } else if (node instanceof AST_Template) {
164 if (top_retain instanceof RegExp) {
168 } else if (typeof top_retain == "function") {
170 } else if (top_retain) {
171 if (typeof top_retain == "string") {
189 if (node._squeezed) return node;
191 if (is_scope) {
192 if (this.option("arrows") && is_arrow(node) && node.value) {
201 // would call AST_Node.transform() if a different instance of AST_Node is
213 if (is_scope && opt === node && !this.has_directive("use asm") && !opt.pinned()) {
215 if (opt.merge_variables(this)) opt.drop_unused(this);
218 if (opt === node) opt._squeezed = true;
225 if (def.exported) return true;
226 if (def.undeclared) return true;
227 if (!(def.global || def.scope.resolve() instanceof AST_Toplevel)) return false;
236 if (this.option("expression")) node.process_expression(true);
244 if (pass > 0 || this.option("reduce_vars"))
248 if (passes > 1) {
258 if (count < min_count) {
261 } else if (stopping) {
268 if (this.option("expression")) node.process_expression(false);
278 if (!compressor.option("hoist_exports")) return;
282 if (stat instanceof AST_ExportDeclaration) {
284 if (stat instanceof AST_Definitions) {
291 } else if (stat instanceof AST_ExportReferences) {
296 if (props.length) body.push(make_node(AST_ExportReferences, this, { properties: props }));
299 if (!(sym instanceof AST_SymbolDeclaration)) return;
309 if (insert) {
310 if (node instanceof AST_Directive) node = make_node(AST_SimpleStatement, node, {
313 if (node instanceof AST_SimpleStatement) {
316 } else if (node instanceof AST_Return) {
317 if (transform) return transform(node);
319 if (value instanceof AST_String) return make_node(AST_Directive, value);
327 if (node instanceof AST_Block) {
328 if (node instanceof AST_Lambda) {
329 if (node !== self) return node;
330 } else if (insert === "awaits" && node instanceof AST_Try) {
331 if (node.bfinally) return node;
335 if (!is_declaration(stat, true)) {
340 } else if (node instanceof AST_If) {
342 if (node.alternative) node.alternative = node.alternative.transform(tt);
343 } else if (node instanceof AST_With) {
360 if (stat instanceof AST_Directive) return make_node(AST_String, stat);
361 if (stat instanceof AST_SimpleStatement) return stat.body;
374 if (!is_statement(self)) self = make_node(AST_SimpleStatement, self, { body: self });
375 … if (!(self instanceof AST_Toplevel)) self = make_node(AST_Toplevel, self, { body: [ self ] });
381 if (key instanceof AST_Node) return;
383 if (obj instanceof AST_Array) {
385 if (key == "length") return make_node_from_constant(elements.length, obj);
386 if (typeof key == "number" && key in elements) value = elements[key];
387 } else if (obj instanceof AST_Lambda) {
388 if (key == "length") {
392 } else if (obj instanceof AST_Object) {
397 if (!can_hoist_property(prop)) return;
398 if (!value && props[i].key === key) value = props[i].value;
405 if (value instanceof AST_Boolean) return native_fns.Boolean[name];
406 if (value instanceof AST_Number) return native_fns.Number[name];
407 if (value instanceof AST_String) return native_fns.String[name];
408 if (name == "valueOf") return false;
409 if (value instanceof AST_Array) return native_fns.Array[name];
410 if (value instanceof AST_Lambda) return native_fns.Function[name];
411 if (value instanceof AST_Object) return native_fns.Object[name];
412 if (value instanceof AST_RegExp) return native_fns.RegExp[name] && !value.value.global;
417 …if (compressor.option("unsafe") && parent instanceof AST_Dot && is_read_only_fn(value, parent.prop…
421 if (lhs) return lhs;
422 if (level == 0 && value && value.is_constant()) return;
423 … if (parent instanceof AST_Array) return is_modified(compressor, tw, parent, parent, level + 1);
424 if (parent instanceof AST_Assign) switch (parent.operator) {
434 if (parent instanceof AST_Binary) {
435 if (!lazy_op[parent.operator]) return;
438 if (parent instanceof AST_Call) {
444 if (parent instanceof AST_Conditional) {
445 if (parent.condition === node) return;
448 if (parent instanceof AST_ForEnumeration) return parent.init === node;
449 if (parent instanceof AST_ObjectKeyVal) {
450 if (parent.value !== node) return;
454 if (parent instanceof AST_PropAccess) {
455 if (parent.expression !== node) return;
459 if (parent instanceof AST_Sequence) {
460 if (parent.tail_node() !== node) return;
479 if (def === sym) return false;
480 if (sym instanceof AST_Scope) return true;
486 if (ref.in_arg && is_funarg(def)) return false;
488 if (sym instanceof AST_SymbolConst || sym instanceof AST_SymbolLet) {
489 if (sym instanceof AST_SymbolImport) return true;
497 if (parent instanceof AST_Assign) return parent.operator == "=" && parent.right === node;
498 … if (parent instanceof AST_Call) return parent.expression !== node || parent instanceof AST_New;
499 if (parent instanceof AST_ClassField) return parent.value === node && !parent.static;
500 …if (parent instanceof AST_Exit) return parent.value === node && scope.resolve() !== d.scope.resolv…
501 if (parent instanceof AST_VarDef) return parent.value === node;
554 if (init instanceof AST_LambdaDefinition) {
558 if (def.fixed === null) {
561 } else if (def.fixed) {
569 if (scope.uses_arguments) scope.each_argname(function(node) {
572 if (compressor.option("ie")) scope.variables.each(function(def) {
574 if (d !== def) d.fixed = false;
592 if (fn.variables.get(d.name) === d) return;
593 if (safe_to_read(tw, d)) return;
596 if (typeof fixed == "function") fixed = fixed();
597 if (fixed instanceof AST_Lambda && fixed.safe_ids !== undefined) return;
604 if (marker === undefined) return;
605 if (marker === false) return;
606 if (fn.parent_scope.resolve().may_call_this === return_true) {
607 if (member(fn, tw.fn_visited)) revisit_fn_def(tw, fn);
608 } else if (marker) {
610 if (marker === tw.safe_ids) {
611 if (!visited) walk_fn_def(tw, fn);
612 } else if (visited) {
617 } else if (tw.fn_scanning && tw.fn_scanning !== def.scope.resolve()) {
628 if (fn.safe_ids === false) return true;
647 if (!sequential) safe_ids.seq = {};
661 if (def.last_ref !== false) def.last_ref = ref;
665 if (def.single_use == "m") return false;
667 if (safe) {
669 if (!in_order) {
671 if (!safe.read) {
673 } else if (safe.read !== seq) {
677 if (def.fixed == null) {
678 if (is_arguments(def)) return false;
679 if (def.global && def.name == "arguments") return false;
682 if (in_order) def.safe_ids = undefined;
691 if (!declare) {
692 … if (is_funarg(def) && def.scope.uses_arguments && !tw.has_directive("use strict")) return false;
693 if (!all(def.orig, function(sym) {
697 if (def.fixed === undefined) return declare || all(def.orig, function(sym) {
700 if (def.fixed === false || def.fixed === 0) return false;
702 if (def.safe_ids) {
707 if (!HOP(tw.safe_ids, def.id)) {
708 if (!safe) return false;
709 if (safe.read || tw.in_loop) {
711 if (scope instanceof AST_Class) return false;
712 if (def.scope.resolve() !== scope.resolve()) return false;
716 if (def.fixed != null && safe.read) {
717 if (safe.read !== tw.safe_ids.seq) return false;
718 if (tw.loop_ids[def.id] !== tw.in_loop) return false;
734 if (!value) return false;
735 if (value instanceof AST_Assign) {
739 if (value instanceof AST_Sequence) return is_immutable(value.tail_node());
744 if (parent instanceof AST_Array) return true;
745 if (parent instanceof AST_Binary) return lazy_op[parent.operator];
746 if (parent instanceof AST_Conditional) return parent.condition !== node;
747 if (parent instanceof AST_Sequence) return parent.tail_node() === node;
748 if (parent instanceof AST_Spread) return true;
753 if (value && value.is_constant()) return;
754 if (has_escaped(d, scope, node, parent)) {
756 if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1;
757 if (!d.escaped.depth || d.escaped.depth > depth) d.escaped.depth = depth;
758 if (d.scope.resolve() !== scope.resolve()) d.escaped.cross_scope = true;
759 if (d.fixed) d.fixed.escaped = d.escaped;
761 } else if (value_in_use(node, parent)) {
763 } else if (parent instanceof AST_ObjectKeyVal && parent.value === node) {
766 } else if (parent instanceof AST_PropAccess && parent.expression === node) {
769 if (value) return;
771 if (level > 0) return;
772 if (parent instanceof AST_Call && parent.expression === node) return;
773 if (parent instanceof AST_Sequence && parent.tail_node() !== node) return;
774 if (parent instanceof AST_SimpleStatement) return;
775 if (parent instanceof AST_Unary && !unary_side_effects[parent.operator]) return;
777 if (d.fixed) d.fixed.direct_access = true;
781 if (!(node instanceof AST_Sub)) return;
783 if (!(expr instanceof AST_SymbolRef)) return;
785 if (!is_arguments(def)) return;
787 if (key.is_constant()) key = key.value;
788 if (!(key instanceof AST_Node) && !RE_POSITIVE_INTEGER.test(key)) return;
791 if (argname instanceof AST_SymbolFunarg) argname.definition().fixed = false;
799 if (prev_save !== current) {
810 if (prev_seq === node) return node;
813 if (ev instanceof AST_Node) {
815 } else if (prev_save !== current) {
825 if (node instanceof AST_DefaultValue) {
831 if (save) fixed = make_fixed_default(compressor, node, save);
836 if (node instanceof AST_DestructuredArray) {
840 if (node instanceof AST_Hole) return reset_flags(node);
841 if (save) fixed = make_fixed(save, function(value) {
849 if (node.rest) {
851 … if (save) fixed = compressor.option("rests") && make_fixed(save, function(value) {
852 if (!(value instanceof AST_Array)) return node;
854 if (value.elements[i] instanceof AST_Spread) return node;
856 if (!fixed_node) fixed_node = make_node(AST_Array, node, {});
865 if (node instanceof AST_DestructuredObject) {
870 if (node.key instanceof AST_Node) {
875 if (save) fixed = make_fixed(save, function(value) {
878 if (typeof key == "string") {
879 if (is_identifier_string(key)) {
892 if (node.rest) {
920 if (hit) return aborts = true;
921 if (node instanceof AST_Return) return hit = true;
922 if (node instanceof AST_Scope && node !== fn) return true;
924 if (aborts) push(tw, sequential);
935 … if (arg instanceof AST_Sequence && arg.expressions.length < 2) arg = arg.expressions[0];
940 … if (rest) scan_declaration(tw, compressor, rest, compressor.option("rests") && function() {
941 if (fn.rest !== rest) return rest;
942 if (!fixed_node) fixed_node = make_node(AST_Array, fn, {});
949 if (!aborts) tw.safe_ids = safe_ids;
954 if (fixed && safe && d.fixed === undefined) {
973 if (left.equals(right) && !left.has_side_effects(compressor)) {
979 if (ld && right instanceof AST_LambdaExpression) {
983 if (!ld.fixed || !node.write_only) mark_fn_def(tw, ld, right);
986 if (scan) {
998 if (!scan) {
1004 if (is_modified(compressor, tw, node, node, 0)) {
1009 if (lazy) push(tw, true);
1011 if (lazy) pop(tw);
1012 if (safe && !left.in_arg && safe_to_assign(tw, ld)) {
1015 if (ld.single_use) ld.single_use = false;
1037 if (lhs instanceof AST_Dot) {
1039 } else if (lhs instanceof AST_Sub) {
1042 } else if (lhs instanceof AST_SymbolRef) {
1045 if (d.fixed) {
1047 if (lhs.fixed.assigns) {
1064 if (!(sym instanceof AST_SymbolRef)) {
1071 if (!fixed || sym.in_arg || !safe_to_assign(tw, d)) {
1077 if (left instanceof AST_Destructured
1091 if (!lazy) return;
1100 if (!lazy_op[this.operator]) return;
1113 if (exp instanceof AST_LambdaExpression) {
1117 if (arg instanceof AST_Spread) iife = false;
1119 if (iife) exp.reduce_vars = reduce_iife;
1121 if (iife) delete exp.reduce_vars;
1124 if (node.TYPE == "Call") switch (tw.in_boolean_context()) {
1132 if (optional) push(tw, true);
1136 if (optional) pop(tw);
1138 if (fixed instanceof AST_Lambda) {
1146 if (node instanceof AST_Assign) {
1147 if (node.operator != "=") return;
1150 } else if (node instanceof AST_Binary) {
1151 if (!lazy_op[node.operator]) return;
1154 } else if (node instanceof AST_Conditional) {
1157 } else if (node instanceof AST_SymbolRef) {
1160 if (drop) def.drop_return++;
1167 if (node.extends) node.extends.walk(tw);
1170 if (prop.key instanceof AST_Node) {
1177 if (node.name) {
1180 …if (parent instanceof AST_ExportDeclaration || parent instanceof AST_ExportDefault) d.single_use =…
1181 if (safe_to_assign(tw, d, true)) {
1188 if (!is_safe_lexical(d)) d.single_use = false;
1195 if (!prop.static || is_static_field_or_init(prop) && prop.value.contains_this()) {
1236 if (has_loop_control(this, tw.parent())) {
1248 if (node.init) node.init.walk(tw);
1252 if (node.condition) node.condition.walk(tw);
1254 if (node.step) {
1255 if (has_loop_control(node, tw.parent())) {
1273 if (init instanceof AST_Definitions) {
1275 if (node instanceof AST_SymbolDeclaration) {
1281 } else if (init instanceof AST_Destructured || init instanceof AST_SymbolRef) {
1283 if (node instanceof AST_SymbolRef) {
1287 if (!node.is_immutable()) def.fixed = false;
1303 if (this.alternative) {
1318 if (!safe_to_visit(tw, fn)) return true;
1319 if (!push_uniq(tw.fn_visited, fn)) return true;
1325 if (fn.name) mark_escaped(tw, fn.name.definition(), fn, fn.name, fn, 0, 1);
1332 …if (parent instanceof AST_ExportDeclaration || parent instanceof AST_ExportDefault) def.single_use…
1333 if (!safe_to_visit(tw, fn)) return true;
1334 if (!push_uniq(tw.fn_visited, fn)) return true;
1343 if (!this.optional) return;
1356 if (branch instanceof AST_Default) return;
1358 if (first) {
1363 if (!first) pop(tw);
1384 if (d.references.length == 1 && !d.fixed && d.orig[0] instanceof AST_SymbolDefun) {
1388 if (recursive) recursive.enclosed.forEach(function(def) {
1389 if (d === def) return;
1390 if (def.scope.resolve() === recursive) return;
1392 if (!assigns) return;
1393 if (assigns[assigns.length - 1] instanceof AST_VarDef) return;
1395 if (!safe) return;
1398 if (d.single_use == "m" && d.fixed) {
1404 if (!safe_to_read(tw, d)) d.fixed = false;
1407 if (redef && cross_scope(d.scope, ref.scope)) redef.single_use = false;
1413 if (!safe_to_read(tw, d)) {
1417 if (ref.in_arg && d.orig[0] instanceof AST_SymbolLambda) ref.fixed = d.scope;
1419 if (recursive) {
1421 } else if (value && ref_once(compressor, d)) {
1432 if (is_modified(compressor, tw, ref, value, 0, is_immutable(value), recursive)) {
1433 if (d.single_use) {
1439 if (d.fixed && tw.loop_ids[d.id] !== tw.in_loop) d.cross_loop = true;
1443 if (!ref.fixed) ref.fixed = d.fixed === 0 ? fixed : d.fixed;
1445 if (value instanceof AST_Lambda
1453 if (!tag) return;
1454 if (tag instanceof AST_LambdaExpression) {
1466 if (fixed instanceof AST_Lambda) {
1490 if (node.bcatch) {
1495 if (node.bfinally) node.bfinally.walk(tw);
1500 if (!UNARY_POSTFIX[node.operator]) return;
1502 if (!(exp instanceof AST_SymbolRef)) {
1509 if (safe_to_read(tw, d) && !exp.in_arg && safe_to_assign(tw, d)) {
1512 if (d.single_use) d.single_use = false;
1525 if (node instanceof AST_UnaryPrefix) {
1548 … if (value instanceof AST_LambdaExpression && node.name instanceof AST_SymbolDeclaration) {
1553 if (!ld.fixed) mark_fn_def(tw, ld, value);
1554 } else if (value) {
1557 } else if (tw.parent() instanceof AST_Let) {
1567 if (fixed && safe_to_assign(tw, d, true)) {
1572 if (name instanceof AST_SymbolConst && d.redefined()
1598 if (node instanceof AST_BlockScope) node._var_names = undefined;
1599 if (node instanceof AST_SymbolRef) node.fixed = undefined;
1625 if (fixed) {
1626 if (this.fixed) fixed = this.fixed;
1630 if (!fixed) return fixed;
1632 if (ref_only && def.escaped.depth != 1 && is_object(value, true)) return value;
1633 if (value.is_constant()) return value;
1638 if (!(def.orig[0] instanceof AST_SymbolLambda)) return false;
1639 if (def.orig.length == 1) return true;
1640 if (!this.in_arg) return false;
1647 if (node instanceof AST_DefaultValue) {
1652 if (node instanceof AST_Destructured) {
1657 if (node instanceof AST_DestructuredKeyVal) {
1682 if (node instanceof AST_DefaultValue) {
1687 if (node instanceof AST_DestructuredKeyVal) {
1688 if (node.key instanceof AST_Node) node.key.walk(tw);
1710 if (found) return true;
1711 if (node instanceof AST_DefaultValue) {
1712 if (!ignore_side_effects) return found = true;
1716 if (node instanceof AST_DestructuredKeyVal) {
1717 if (!ignore_side_effects && node.key instanceof AST_Node) return found = true;
1721 if (predicate(node)) return found = true;
1736 if (node.variables) return node;
1742 if (parent === scope) return false;
1743 if (sync && parent instanceof AST_Lambda) {
1744 if (parent.name || is_async(parent) || is_generator(parent)) return true;
1745 } else if (parent instanceof AST_Try) {
1746 if (parent.bfinally && parent.bfinally !== node) return true;
1747 if (may_throw && parent.bcatch && parent.bcatch !== node) return true;
1755 if (lhs instanceof AST_Atom) return true;
1756 if (lhs instanceof AST_ObjectIdentity) return true;
1757 if (lhs instanceof AST_PropAccess) {
1758 if (lhs.property === "__proto__") return true;
1760 if (lhs instanceof AST_SymbolRef) {
1761 if (lhs.is_immutable()) return false;
1764 if (!lhs) return true;
1765 if (lhs.tail_node().is_constant()) return true;
1768 if (lhs instanceof AST_SymbolRef) {
1769 if (lhs.is_immutable()) return true;
1777 if (props) {
1787 if (expressions.length == 1) return expressions[0];
1796 if (isNaN(val)) return make_node(AST_NaN, orig);
1797 if (isFinite(val)) {
1812 if (val === null) {
1815 if (val instanceof RegExp) {
1832 if (parent.TYPE == "Call") {
1834 } else if (parent instanceof AST_Template) {
1836 } else if (parent instanceof AST_UnaryPrefix) {
1846 if (!(node instanceof AST_SymbolRef)) return;
1849 if (!fixed || !fixed_by_id.has(def.id)) {
1851 } else if (fixed_by_id.get(def.id) !== fixed) {
1855 if (fixed_by_id.size() > 0) target.walk(new TreeWalker(function(node) {
1856 if (!(node instanceof AST_SymbolRef)) return;
1859 if (!fixed || !fixed_by_id.has(def.id)) return;
1860 if (fixed_by_id.get(def.id) !== fixed) node.fixed = false;
1866 if (node instanceof AST_Sequence) {
1879 if (stat instanceof AST_LambdaDefinition) {
1885 if (s === scope) return true;
1893 if (thing === null) return [];
1894 …if (thing instanceof AST_BlockStatement) return all(thing.body, safe_to_trim) ? thing.body : [ thi…
1895 if (thing instanceof AST_EmptyStatement) return [];
1896 if (is_statement(thing)) return [ thing ];
1901 if (thing === null) return true;
1902 if (thing instanceof AST_EmptyStatement) return true;
1903 if (thing instanceof AST_BlockStatement) return thing.body.length == 0;
1916 if (x instanceof AST_IterationStatement) {
1923 if (node.TYPE != "Call") return false;
1932 if (exp.name) return false;
1933 if (!(call instanceof AST_New)) return true;
1936 if (found) return true;
1937 if (node instanceof AST_NewTarget) return found = true;
1938 if (node instanceof AST_Scope && node !== exp) return true;
1965 …if (stat instanceof AST_DefClass) return lexical && !stat.extends && all(stat.properties, function…
1966 if (prop.key instanceof AST_Node) return false;
1969 …if (stat instanceof AST_Definitions) return (lexical || stat instanceof AST_Var) && declarations_o…
1970 if (stat instanceof AST_ExportDeclaration) return is_declaration(stat.body, lexical);
1971 if (stat instanceof AST_ExportDefault) return is_declaration(stat.body, lexical);
1977 if (index < 0) return false;
1979 if (!is_declaration(body[index], true)) return false;
1991 if (node.init instanceof AST_BlockStatement) {
1996 if (node.init instanceof AST_Defun) {
1997 if (!block) block = make_node(AST_BlockStatement, node, { body: [ node ] });
2000 } else if (node.init instanceof AST_SimpleStatement) {
2002 } else if (is_empty(node.init)) {
2005 if (!block) return;
2019 if (eliminate_spurious_blocks(statements)) changed = 1;
2020 if (!changed && last_changed == 1) break;
2021 if (compressor.option("dead_code")) {
2022 if (eliminate_dead_code(statements, compressor)) changed = 2;
2023 if (!changed && last_changed == 2) break;
2025 if (compressor.option("if_return")) {
2026 if (handle_if_return(statements, compressor)) changed = 3;
2027 if (!changed && last_changed == 3) break;
2029 if (compressor.option("awaits") && compressor.option("side_effects")) {
2030 if (trim_awaits(statements, compressor)) changed = 4;
2031 if (!changed && last_changed == 4) break;
2033 if (compressor.option("inline") >= 4) {
2034 if (inline_iife(statements, compressor)) changed = 5;
2035 if (!changed && last_changed == 5) break;
2037 if (compressor.sequences_limit > 0) {
2038 if (sequencesize(statements, compressor)) changed = 6;
2039 if (!changed && last_changed == 6) break;
2040 if (sequencesize_2(statements, compressor)) changed = 7;
2041 if (!changed && last_changed == 7) break;
2043 if (compressor.option("join_vars")) {
2044 if (join_consecutive_vars(statements)) changed = 8;
2045 if (!changed && last_changed == 8) break;
2047 if (compressor.option("collapse_vars")) {
2048 if (collapse(statements, compressor)) changed = 9;
2056 if (block instanceof AST_Catch) {
2058 } else if (block instanceof AST_LabeledStatement) {
2060 } else if (block instanceof AST_SwitchBranch) {
2062 … if (branches.body[branches.body.length - 1] === block || has_break(block.body)) {
2069 if (predicate(stat)) return stat;
2082 if (stats[i] instanceof AST_Break) return true;
2091 if (!block_scope && node.variables) block_scope = node;
2092 if (node instanceof AST_Catch) {
2093 if (compressor.parent(level).bfinally) {
2094 if (!in_try) in_try = {};
2098 } else if (node instanceof AST_Finally) {
2100 } else if (node instanceof AST_IterationStatement) {
2102 } else if (node instanceof AST_Scope) {
2105 } else if (node instanceof AST_Try) {
2106 if (!in_try) in_try = {};
2107 if (node.bcatch) in_try.bcatch = true;
2108 if (node.bfinally) in_try.bfinally = true;
2122 if (scope.pinned()) return;
2131 if (abort) return node;
2133 if (!hit) {
2134 if (node !== hit_stack[hit_index]) return node;
2136 … if (hit_index < hit_stack.length) return handle_custom_scan_order(node, scanner);
2139 if (stop_after === node) abort = true;
2143 // Stop only if candidate is found within conditional branches
2144 if (!stop_if_hit && in_conditional(node, parent)) {
2148 if (compound && scan_lhs && can_replace && !stop_if_hit
2158 if (abort) {
2178 // Stop immediately if these node types are encountered
2179 if (should_stop(node, parent)) {
2184 if (node.single_use) return node;
2187 if (!(node instanceof AST_SymbolDeclaration)
2190 if (!can_replace || stop_if_hit && (hit_rhs || !lhs_local || !replace_all)) {
2191 if (!hit_rhs && !value_def) abort = true;
2194 if (is_lhs(node, parent)) {
2195 if (value_def && !hit_rhs) assign_used = true;
2198 if (!hit_rhs && verify_ref && node.fixed !== lhs.fixed) {
2202 if (value_def) {
2203 if (stop_if_hit && assign_pos == 0) assign_pos = remaining - replaced;
2204 if (!hit_rhs) replaced++;
2210 if (candidate.TYPE == "Binary") {
2226 … if (candidate instanceof AST_UnaryPostfix) return make_node(AST_UnaryPrefix, candidate, {
2230 if (candidate instanceof AST_UnaryPrefix) {
2235 if (candidate instanceof AST_VarDef) {
2237 if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) {
2253 if (should_stop_ref(node, parent)) {
2259 if (is_last_node(node, parent) || may_throw(node)) {
2261 if (node instanceof AST_Scope) abort = true;
2264 if (node instanceof AST_Accessor) {
2272 if (node instanceof AST_Destructured) {
2280 if (node instanceof AST_DefaultValue) {
2289 if (node instanceof AST_BlockScope
2296 if (!handle_custom_scan_order(node, scanner)) descend(node, scanner);
2300 if (handle_custom_scan_order(node, scanner)) return signal_abort(node);
2303 if (abort) return node;
2305 if (!hit) {
2306 if (node !== hit_stack[hit_index]) return node;
2311 if (assign_used) return node;
2312 if (node !== candidate) return node;
2313 if (node instanceof AST_VarDef) return node;
2316 if (parent instanceof AST_Sequence && parent.tail_node() !== node) {
2318 if (rvalue === rhs_value) return List.skip;
2323 if (!assign_used && node.body === candidate) {
2334 if (node instanceof AST_SymbolRef && node.definition() === def) {
2335 if (is_lhs(node, multi_replacer.parent())) return node;
2336 if (!--replaced) abort = true;
2341 if (replaced == assign_pos) {
2353 if (node instanceof AST_Default || node instanceof AST_Scope) return node;
2362 if (stat_index == 0 && compressor.option("unused")) extract_args();
2382 if (!scan_lhs && !scan_rhs) continue;
2386 if (candidate.may_throw(compressor)) {
2387 if (funarg && is_async(scope)) continue;
2401 if (!side_effects) {
2402 … if (!compound && rvalue instanceof AST_Sequence) rvalue = rvalue.tail_node();
2413 if (!can_replace) {
2415 if (args[j]) args[j].transform(scanner);
2422 if (value_def) {
2423 if (!replaced || remaining > replaced + assign_used) {
2428 if (replaced == assign_pos) assign_used = true;
2434 if (!statements[i].transform(multi_replacer)) statements.splice(i--, 1);
2444 if (replaced) remove_candidate(candidate);
2450 if (abort) return node;
2451 if (stop_after === node) abort = true;
2452 if (stop_if_hit === node) stop_if_hit = null;
2457 if (!(node instanceof AST_BlockScope)) return;
2459 if (node instanceof AST_Scope) return node;
2461 if (node instanceof AST_Class) {
2462 if (node.name) node.name = node.name.transform(tt);
2463 if (!abort && node.extends) node.extends = node.extends.transform(tt);
2467 if (prop.key instanceof AST_Node) prop.key = prop.key.transform(tt);
2468 if (!prop.static) continue;
2469 if (prop instanceof AST_ClassField) {
2470 if (prop.value) fields.push(prop);
2471 } else if (prop instanceof AST_ClassInit) {
2485 if (node instanceof AST_ForEnumeration) {
2491 if (node instanceof AST_Switch) {
2495 if (branch instanceof AST_Case) {
2496 if (!hit) {
2497 if (branch !== hit_stack[hit_index]) continue;
2501 if (!replace_all) break;
2511 … if (parent instanceof AST_Assign) return parent.operator == "=" && parent.left === node;
2512 if (parent instanceof AST_DefaultValue) return parent.name === node;
2513 if (parent instanceof AST_DestructuredArray) return true;
2514 if (parent instanceof AST_DestructuredKeyVal) return parent.value === node;
2518 if (node === rvalue) return true;
2519 if (parent instanceof AST_For) {
2520 if (node !== parent.init) return true;
2522 if (node instanceof AST_Assign) {
2525 if (node instanceof AST_Call) {
2526 if (!(lhs instanceof AST_PropAccess)) return false;
2527 if (!lhs.equals(node.expression)) return false;
2530 if (node instanceof AST_Class) return !compressor.has_directive("use strict");
2531 if (node instanceof AST_Debugger) return true;
2532 if (node instanceof AST_Defun) return funarg && lhs.name === node.name.name;
2533 if (node instanceof AST_DestructuredKeyVal) return node.key instanceof AST_Node;
2534 if (node instanceof AST_DWLoop) return true;
2535 if (node instanceof AST_LoopControl) return true;
2536 if (node instanceof AST_Try) return true;
2537 if (node instanceof AST_With) return true;
2542 if (!(node instanceof AST_SymbolRef)) return false;
2543 if (node.is_declared(compressor)) {
2544 if (node.fixed_value()) return false;
2545 if (can_drop_symbol(node)) {
2549 } else if (is_direct_assignment(node, parent)) {
2552 if (!replace_all) return true;
2558 …if (parent instanceof AST_Assign) return parent.left !== node && lazy_op[parent.operator.slice(0, …
2559 … if (parent instanceof AST_Binary) return parent.left !== node && lazy_op[parent.operator];
2560 … if (parent instanceof AST_Call) return parent.optional && parent.expression !== node;
2561 if (parent instanceof AST_Case) return parent.expression !== node;
2562 if (parent instanceof AST_Conditional) return parent.condition !== node;
2563 if (parent instanceof AST_If) return parent.condition !== node;
2564 if (parent instanceof AST_Sub) return parent.optional && parent.expression !== node;
2568 if (node instanceof AST_Await) return true;
2569 … if (node.TYPE == "Binary") return !can_drop_op(node.operator, node.right, compressor);
2570 if (node instanceof AST_Call) {
2572 if (fn instanceof AST_SymbolRef) {
2576 if (!(fn instanceof AST_Lambda)) return !node.is_expr_pure(compressor);
2577 if (def && recursive_ref(compressor, def, fn)) return true;
2578 if (fn.collapse_scanning) return false;
2585 if (arg_may_throw(reject, fn.argnames[i], node.args[i])) abort = true;
2587 if (!abort) {
2588 if (fn.rest && arg_may_throw(reject, fn.rest, make_node(AST_Array, node, {
2592 } else if (is_arrow(fn) && fn.value) {
2596 if (stat instanceof AST_Return) {
2597 if (stat.value) stat.value.transform(scanner);
2607 if (!abort) return false;
2611 if (node instanceof AST_Class) {
2612 if (!in_try) return false;
2614 if (!base) return false;
2615 if (base instanceof AST_SymbolRef) base = base.fixed_value();
2618 if (node instanceof AST_Exit) {
2619 if (in_try) {
2620 if (in_try.bfinally) return true;
2621 if (in_try.bcatch && node instanceof AST_Throw) return true;
2625 if (node instanceof AST_Function) {
2628 if (node instanceof AST_ObjectIdentity) return symbol_in_lvalues(node, parent);
2629 if (node instanceof AST_PropAccess) {
2630 if (side_effects) return true;
2632 if (exp instanceof AST_SymbolRef && is_arguments(exp.definition())) return true;
2633 if (compressor.option("unsafe")) {
2634 if (is_undeclared_ref(exp) && global_names[exp.name]) return false;
2635 if (is_static_fn(exp)) return false;
2637 if (!well_defined) return true;
2638 if (value_def) return false;
2639 if (!in_try && lhs_local) return false;
2640 if (node.optional) return false;
2643 if (node instanceof AST_Spread) return true;
2644 if (node instanceof AST_SymbolRef) {
2645 if (symbol_in_lvalues(node, parent)) return !is_direct_assignment(node, parent);
2646 if (side_effects && may_modify(node)) return true;
2650 if (node instanceof AST_Template) return !node.is_expr_pure(compressor);
2651 if (node instanceof AST_VarDef) {
2652 if (check_destructured(node.name)) return true;
2658 if (node instanceof AST_Yield) return true;
2660 if (!sym) return false;
2661 if (sym instanceof AST_PropAccess) return true;
2662 if (check_destructured(sym)) return true;
2675 if (node instanceof AST_DefaultValue) {
2680 if (!value) return !(node instanceof AST_Symbol);
2681 if (node instanceof AST_Destructured) {
2682 if (node.rest && arg_may_throw(reject, node.rest)) return true;
2683 if (node instanceof AST_DestructuredArray) {
2684 … if (value instanceof AST_Array) return !all(node.elements, function(element, index) {
2687 if (!value.is_string(compressor)) return true;
2692 if (node instanceof AST_DestructuredObject) {
2693 if (value.may_throw_on_access(compressor)) return true;
2695 if (prop.key instanceof AST_Node && reject(prop.key)) return false;
2703 if (in_iife_single === false) return;
2705 if (in_iife_single === undefined) {
2706 if (!(fn instanceof AST_LambdaExpression)
2718 if (!is_iife_single(iife)) return;
2724 if (is_async(fn)) {
2733 … if (iife_in_try === undefined) iife_in_try = find_try(compressor, 1, iife, null, true, true);
2737 if (!arg) return true;
2738 if (has_await(node) || node instanceof AST_Yield) {
2742 if (node instanceof AST_ObjectIdentity) {
2743 if (fn_strict || !arg_scope) arg = null;
2746 if (node instanceof AST_SymbolRef) {
2748 if (node.in_arg && !is_safe_lexical(node.definition())
2754 if (node instanceof AST_Scope && !is_arrow(node)) {
2769 if (sym instanceof AST_DefaultValue) {
2774 if (sym instanceof AST_Destructured) {
2775 if (iife_in_try && arg_may_throw(function(node) {
2784 if (names.has(sym.name)) continue;
2786 if (value) arg = is_undefined(arg) ? value : null;
2787 if (!arg && !value) {
2789 } else if (arg instanceof AST_Lambda && arg.pinned()) {
2791 } else if (arg) {
2794 if (!arg) continue;
2803 if (fn.rest) args.push(fn.rest);
2808 if (expr instanceof AST_Array) {
2812 } else if (expr instanceof AST_Assign) {
2814 if (!(lhs instanceof AST_Destructured)) candidates.push(hit_stack.slice());
2817 if (lhs instanceof AST_SymbolRef && expr.operator == "=") {
2820 } else if (expr instanceof AST_Await) {
2822 } else if (expr instanceof AST_Binary) {
2824 if (unused
2834 } else if (expr instanceof AST_Call) {
2837 } else if (expr instanceof AST_Case) {
2839 } else if (expr instanceof AST_Conditional) {
2843 } else if (expr instanceof AST_Definitions) {
2845 } else if (expr instanceof AST_Dot) {
2847 } else if (expr instanceof AST_DWLoop) {
2849 if (!(expr.body instanceof AST_Block)) {
2852 } else if (expr instanceof AST_Exit) {
2853 if (expr.value) extract_candidates(expr.value);
2854 } else if (expr instanceof AST_For) {
2855 if (expr.init) extract_candidates(expr.init, true);
2856 if (expr.condition) extract_candidates(expr.condition);
2857 if (expr.step) extract_candidates(expr.step, true);
2858 if (!(expr.body instanceof AST_Block)) {
2861 } else if (expr instanceof AST_ForEnumeration) {
2863 if (!(expr.body instanceof AST_Block)) {
2866 } else if (expr instanceof AST_If) {
2868 if (!(expr.body instanceof AST_Block)) {
2871 if (expr.alternative && !(expr.alternative instanceof AST_Block)) {
2874 } else if (expr instanceof AST_Object) {
2877 if (prop.key instanceof AST_Node) extract_candidates(prop.key);
2878 … if (prop instanceof AST_ObjectKeyVal) extract_candidates(prop.value, unused);
2881 } else if (expr instanceof AST_Sequence) {
2886 } else if (expr instanceof AST_SimpleStatement) {
2888 } else if (expr instanceof AST_Spread) {
2890 } else if (expr instanceof AST_Sub) {
2893 } else if (expr instanceof AST_Switch) {
2896 } else if (expr instanceof AST_Unary) {
2897 if (UNARY_POSTFIX[expr.operator]) {
2902 } else if (expr instanceof AST_VarDef) {
2903 if (expr.name instanceof AST_SymbolVar) {
2904 if (expr.value) {
2906 if (def.references.length > def.replaced) {
2913 if (expr.value) extract_candidates(expr.value);
2914 } else if (expr instanceof AST_Yield) {
2915 if (expr.expression) extract_candidates(expr.expression);
2922 if (parent instanceof AST_Array) return node;
2923 if (parent instanceof AST_Assign) return node;
2924 if (parent instanceof AST_Await) return node;
2925 if (parent instanceof AST_Binary) return node;
2926 if (parent instanceof AST_Call) return node;
2927 if (parent instanceof AST_Case) return node;
2928 if (parent instanceof AST_Conditional) return node;
2929 if (parent instanceof AST_Definitions) return find_stop_unused(parent, level + 1);
2930 if (parent instanceof AST_Exit) return node;
2931 if (parent instanceof AST_If) return node;
2932 if (parent instanceof AST_IterationStatement) return node;
2933 if (parent instanceof AST_ObjectProperty) return node;
2934 if (parent instanceof AST_PropAccess) return node;
2935 if (parent instanceof AST_Sequence) {
2938 … if (parent instanceof AST_SimpleStatement) return find_stop_unused(parent, level + 1);
2939 if (parent instanceof AST_Spread) return node;
2940 if (parent instanceof AST_Switch) return node;
2941 if (parent instanceof AST_Unary) return node;
2942 if (parent instanceof AST_VarDef) return node;
2943 if (parent instanceof AST_Yield) return node;
2969 if (abort) {
2978 if (parent instanceof AST_Array) return find_stop_value(parent, level + 1);
2979 if (parent instanceof AST_Assign) {
2980 if (may_throw(parent)) return node;
2981 if (parent.left.match_symbol(function(ref) {
2985 if (parent.left === node || !lazy_op[op = parent.operator.slice(0, -1)]) {
2990 if (parent instanceof AST_Await) return find_stop_value(parent, level + 1);
2991 if (parent instanceof AST_Binary) {
2993 if (parent.left === node || !lazy_op[op = parent.operator]) {
2998 if (parent instanceof AST_Call) return parent;
2999 if (parent instanceof AST_Case) {
3000 if (parent.expression !== node) return node;
3003 if (parent instanceof AST_Conditional) {
3004 if (parent.condition !== node) return node;
3007 if (parent instanceof AST_Definitions) return find_stop_unused(parent, level + 1);
3008 if (parent instanceof AST_Do) return node;
3009 if (parent instanceof AST_Exit) return find_stop_unused(parent, level + 1);
3010 if (parent instanceof AST_For) {
3011 if (parent.init !== node && parent.condition !== node) return node;
3014 if (parent instanceof AST_ForEnumeration) {
3015 if (parent.init !== node) return node;
3018 if (parent instanceof AST_If) {
3019 if (parent.condition !== node) return node;
3022 if (parent instanceof AST_ObjectProperty) {
3028 if (parent instanceof AST_PropAccess) {
3032 if (parent instanceof AST_Sequence) {
3035 … if (parent instanceof AST_SimpleStatement) return find_stop_unused(parent, level + 1);
3036 if (parent instanceof AST_Spread) return find_stop_value(parent, level + 1);
3037 if (parent instanceof AST_Switch) {
3038 if (parent.expression !== node) return node;
3041 if (parent instanceof AST_Unary) {
3042 if (parent.operator == "delete") return node;
3045 if (parent instanceof AST_VarDef) return parent.name.match_symbol(function(sym) {
3048 if (parent instanceof AST_While) {
3049 if (parent.condition !== node) return node;
3052 if (parent instanceof AST_Yield) return find_stop_value(parent, level + 1);
3058 if (is_last_node(node, parent)) return node;
3059 if (in_conditional(node, parent)) return node;
3060 if (parent instanceof AST_Array) return find_stop_unused(parent, level + 1);
3061 if (parent instanceof AST_Assign) return check_assignment(parent.left);
3062 if (parent instanceof AST_Await) return node;
3063 if (parent instanceof AST_Binary) return find_stop_unused(parent, level + 1);
3064 if (parent instanceof AST_Call) return find_stop_unused(parent, level + 1);
3065 if (parent instanceof AST_Case) return find_stop_unused(parent, level + 1);
3066 if (parent instanceof AST_Conditional) return find_stop_unused(parent, level + 1);
3067 if (parent instanceof AST_Definitions) return find_stop_unused(parent, level + 1);
3068 if (parent instanceof AST_Exit) return find_stop_unused(parent, level + 1);
3069 if (parent instanceof AST_If) return find_stop_unused(parent, level + 1);
3070 if (parent instanceof AST_IterationStatement) return node;
3071 if (parent instanceof AST_ObjectProperty) {
3077 if (parent instanceof AST_PropAccess) {
3079 if (exp === node) return find_stop_unused(parent, level + 1);
3082 if (parent instanceof AST_Sequence) return find_stop_unused(parent, level + 1);
3083 … if (parent instanceof AST_SimpleStatement) return find_stop_unused(parent, level + 1);
3084 if (parent instanceof AST_Spread) return node;
3085 if (parent instanceof AST_Switch) return find_stop_unused(parent, level + 1);
3086 if (parent instanceof AST_Unary) return find_stop_unused(parent, level + 1);
3087 if (parent instanceof AST_VarDef) return check_assignment(parent.name);
3088 if (parent instanceof AST_Yield) return node;
3092 if (may_throw(parent)) return node;
3093 if (lhs !== node && lhs instanceof AST_Destructured) {
3101 if (force_single) {
3105 if (remaining < 1) return;
3108 if (!(value instanceof AST_SymbolRef)) return;
3110 if (def.undeclared) return;
3111 if (is_arguments(def)) return;
3112 if (value !== rhs) {
3113 if (is_lhs_read_only(value, compressor)) return;
3115 if (referenced < 2) return;
3118 if (candidate.name_index >= 0) {
3132 if (expr instanceof AST_Assign) {
3134 if (!(lhs instanceof AST_SymbolRef)) return lhs;
3136 if (scope.uses_arguments && is_funarg(def)) return lhs;
3137 if (compressor.exposed(def)) return lhs;
3139 if (def.fixed && lhs.fixed) {
3143 if (matches < remaining) {
3149 if (expr.operator == "=") mangleable_var(expr.right);
3152 if (expr instanceof AST_Binary) return expr.right.left;
3153 if (expr instanceof AST_Unary) return expr.expression;
3154 if (expr instanceof AST_VarDef) {
3157 if (def.const_redefs) return;
3158 if (!member(lhs, def.orig)) return;
3159 if (scope.uses_arguments && is_funarg(def)) return;
3162 … if (def.fixed) remaining = Math.min(remaining, def.references.filter(function(ref) {
3163 if (!ref.fixed) return true;
3164 if (!ref.fixed.assigns) return true;
3168 if (declared > 1 && !(lhs instanceof AST_SymbolFunarg)) {
3172 if (mangleable_var(expr.value) || remaining == 1 && !compressor.exposed(def)) {
3180 if (expr instanceof AST_Assign) return expr.right;
3181 if (expr instanceof AST_Binary) {
3186 if (expr instanceof AST_VarDef) return expr.value;
3190 if (expr instanceof AST_Array) return false;
3191 if (expr instanceof AST_Binary && lazy_op[expr.operator]) {
3194 if (expr instanceof AST_Call) return false;
3195 if (expr instanceof AST_Conditional) {
3198 if (expr instanceof AST_Object) return false;
3203 if (expr instanceof AST_Assign && expr.right.single_use) return;
3206 if (node instanceof AST_SymbolRef) lhs_ids[node.definition().id] = true;
3212 if (expr instanceof AST_ObjectIdentity) return rhs_exact_match;
3213 if (expr instanceof AST_SymbolRef) {
3215 if (value === expr) return rhs_exact_match;
3218 if (expr.is_truthy()) return rhs_fuzzy_match(true, return_false);
3219 if (expr.is_constant()) {
3221 if (!(ev instanceof AST_Node)) return rhs_fuzzy_match(ev, rhs_exact_match);
3223 if (!(lhs instanceof AST_SymbolRef)) return false;
3224 if (!invariant(expr)) return false;
3227 if (circular) return true;
3228 … if (node instanceof AST_SymbolRef && lhs_ids[node.definition().id]) circular = true;
3239 if (tw.in_boolean_context()) {
3240 if (value && node.is_truthy() && !node.has_side_effects(compressor)) {
3243 if (node.is_constant()) {
3245 if (!(ev instanceof AST_Node)) return !ev == !value;
3255 if (!(assign instanceof AST_Assign)) break;
3263 if (node instanceof AST_BlockScope) return true;
3264 if (node instanceof AST_Symbol) node.scope = scope;
3269 if (node instanceof AST_SymbolRef) {
3271 if (!node) return true;
3273 … if (node instanceof AST_Assign) return node.operator == "=" && may_be_global(node.right);
3279 if (expr instanceof AST_VarDef) {
3280 if (!expr.name.definition().fixed) well_defined = false;
3287 if (node instanceof AST_SymbolRef) {
3289 if (!value) {
3293 if (!def.undeclared
3299 } else if (node instanceof AST_ObjectIdentity) {
3302 if (value) {
3304 } else if (node instanceof AST_Lambda) {
3306 if (parent instanceof AST_Assign) {
3307 if (parent.left === child) break;
3308 if (parent.operator == "=") continue;
3309 if (lazy_op[parent.operator.slice(0, -1)]) continue;
3312 if (parent instanceof AST_Binary) {
3313 if (lazy_op[parent.operator]) continue;
3316 if (parent instanceof AST_Call) return;
3317 if (parent instanceof AST_Scope) return;
3318 if (parent instanceof AST_Sequence) {
3319 if (parent.tail_node() === child) continue;
3322 if (parent instanceof AST_Template) {
3323 if (parent.tag) return;
3328 if (def.scope !== node) enclosed.set(def.name, true);
3331 } else if (find_arguments && node instanceof AST_Sub) {
3333 … if (!compressor.option("reduce_vars") || argname.definition().assignments) {
3334 if (!argname.definition().fixed) well_defined = false;
3340 if (!scan_toplevel) return;
3341 if (node.TYPE == "Call") {
3342 if (modify_toplevel) return;
3344 if (exp instanceof AST_PropAccess) return;
3345 if (exp instanceof AST_LambdaExpression && !exp.contains_this()) return;
3347 } else if (node instanceof AST_PropAccess && may_be_global(node.expression)) {
3348 if (node === lhs && !(expr instanceof AST_Unary)) {
3362 if (index >= 0) {
3364 if (argname instanceof AST_DefaultValue) {
3367 } else if ((args = compressor.parent().args)[index]) {
3375 if (last instanceof AST_VarDef || hit_stack[end - 1].body === last) end--;
3377 if (hit) return node;
3378 if (node !== hit_stack[hit_index]) return node;
3380 if (hit_index <= end) return handle_custom_scan_order(node, tt);
3382 if (node instanceof AST_Definitions) {
3384 if (value_def) value_def.replaced++;
3389 if (!value) {
3394 if (index > 0) {
3405 if (!value) return in_list ? List.skip : null;
3408 if (node instanceof AST_For) return patch_for_init(node, in_list);
3414 …if (!(statements[stat_index] = statements[stat_index].transform(tt))) statements.splice(stat_index…
3418 if (node instanceof AST_Sequence) switch (node.expressions.length) {
3426 if (!(sym instanceof AST_SymbolRef)) return false;
3427 if (sym.definition().scope.resolve() !== scope) return false;
3428 if (!in_loop) return true;
3429 if (compound) return false;
3430 if (candidate instanceof AST_Unary) return false;
3436 if (candidate instanceof AST_Unary) return false;
3441 if (expr instanceof AST_Unary) return false;
3442 if (side_effects) return false;
3443 if (value_def) return true;
3444 if (!(lhs instanceof AST_SymbolRef)) return false;
3446 if (expr instanceof AST_VarDef) {
3448 } else if (expr.operator == "=") {
3454 if (def.references.length - def.replaced == referenced) return true;
3455 if (!def.fixed) return false;
3456 if (!lhs.fixed) return false;
3459 if (!all(def.references, function(ref, index) {
3461 if (!fixed) return false;
3462 if (fixed.to_binary || fixed.to_prefix) return false;
3463 if (fixed === lhs.fixed) {
3469 if (matched != referenced) return false;
3476 if (!lvalue || all(lvalue, function(lhs) {
3479 if (lvalue[0] !== lhs) return true;
3485 if (def.orig.length == 1 && def.orig[0] instanceof AST_SymbolDefun) return false;
3486 if (def.scope.resolve() !== scope) return true;
3487 if (modify_toplevel && compressor.exposed(def)) return true;
3494 if (node instanceof AST_Assign) return side_effects_external(node.left, true);
3495 if (node instanceof AST_Unary) return side_effects_external(node.expression, true);
3496 … if (node instanceof AST_VarDef) return node.value && side_effects_external(node.value);
3497 if (lhs) {
3498 … if (node instanceof AST_Dot) return side_effects_external(node.expression, true);
3499 … if (node instanceof AST_Sub) return side_effects_external(node.expression, true);
3500 … if (node instanceof AST_SymbolRef) return node.definition().scope.resolve() !== scope;
3510 if (stat instanceof AST_BlockStatement) {
3511 if (all(stat.body, safe_to_trim)) {
3519 if (stat instanceof AST_Directive) {
3520 if (member(stat.value, seen_dirs)) {
3527 if (stat instanceof AST_EmptyStatement) {
3551 if (in_lambda && declare_only && !next && stat instanceof AST_Return
3554 if (!body) {
3560 if (is_undefined(tail)) {
3562 if (body instanceof AST_UnaryPrefix) {
3564 } else if (tail instanceof AST_UnaryPrefix) {
3573 if (stat instanceof AST_If) {
3575 … // if (foo()) { bar(); return; } else baz(); moo(); ---> if (foo()) bar(); else { baz(); moo(); }
3576 if (can_merge_flow(ab)) {
3577 if (ab.label) remove(ab.label.thedef.references, ab);
3591 … // if (foo()) { bar(); return x; } return y; ---> if (!foo()) return y; bar(); return x;
3592 if (ab && !stat.alternative && next instanceof AST_Jump) {
3596 if (cond !== stat.condition) {
3605 // proceed further only if `TreeWalker.stack` is in a consistent state
3608 … if (!in_lambda || self instanceof AST_Block && self.body === statements) {
3615 … // if (foo()) bar(); else { baz(); return; } moo(); ---> if (foo()) { bar(); moo(); } else baz();
3616 if (can_merge_flow(alt)) {
3617 if (alt.label) remove(alt.label.thedef.references, alt);
3631 if (compressor.option("typeofs")) {
3632 if (ab && !alt) {
3636 if (!ab && alt) {
3643 if (stat instanceof AST_If && stat.body instanceof AST_Return) {
3646 // if (foo()) return x; return y; ---> return foo() ? x : y;
3647 if (!stat.alternative && next instanceof AST_Return
3658 // if (foo()) return x; [ return ; ] ---> return foo() ? x : undefined;
3659 … // if (foo()) return bar() ? x : void 0; ---> return foo() && bar() ? x : void 0;
3660 … // if (foo()) return bar() ? void 0 : x; ---> return !foo() || bar() ? void 0 : x;
3661 if (in_lambda && declare_only && !next && !stat.alternative && (in_bool
3672 // if (a) return b; if (c) return d; e; ---> return a ? b : c ? d : void e;
3674 // if sequences is not enabled, this can lead to an endless loop (issue #866).
3678 if (chain_if_returns && !stat.alternative
3697 if (stat instanceof AST_Break || stat instanceof AST_Exit) {
3702 if (declare_only && jump && jump === next) eliminate_returns(stat);
3710 if (stat instanceof AST_If && stat.body instanceof AST_Return) {
3711 if (++n > 1) return true;
3724 if (!jump) return false;
3725 if (jump.TYPE != ab.TYPE) return false;
3727 if (!value) return false;
3729 if (!equals && value instanceof AST_Sequence) {
3731 if (jump.value && jump.value.equals(value)) equals = 2;
3733 if (!equals && !exact && jump.value instanceof AST_Sequence) {
3734 if (jump.value.tail_node().equals(value)) equals = 3;
3740 if (ab instanceof AST_Exit) {
3741 if (merge_jump = match_return(ab)) return true;
3742 if (!in_lambda) return false;
3743 if (!(ab instanceof AST_Return)) return false;
3745 if (value && !is_undefined(value.tail_node())) return false;
3746 if (!(self instanceof AST_SwitchBranch)) return true;
3747 if (!jump) return false;
3748 if (jump instanceof AST_Exit && jump.value) return false;
3752 if (!(ab instanceof AST_LoopControl)) return false;
3753 if (self instanceof AST_SwitchBranch) {
3754 if (jump instanceof AST_Exit) {
3755 if (!in_lambda) return false;
3756 if (jump.value) return false;
3758 } else if (jump) {
3759 if (compressor.loopcontrol_target(jump) !== parent) return false;
3761 } else if (jump === false) {
3766 if (ab instanceof AST_Continue) return match_target(loop_body(lct));
3767 if (lct instanceof AST_IterationStatement) return false;
3773 if (!can_drop_abort(ab)) return false;
3776 if (stat instanceof AST_DefClass) {
3777 if (stat.name.definition().preinit) return false;
3778 } else if (stat instanceof AST_Const || stat instanceof AST_Let) {
3779 if (!all(stat.definitions, function(defn) {
3793 if (!mode) {
3796 } else if (stop) {
3800 if (stop !== jump) jump = false;
3803 if (stat instanceof AST_LambdaDefinition) {
3807 if (is_lexical_definition(stat)) lexical = true;
3810 if (mode === 3) {
3821 if (value) switch (mode) {
3825 if (!(value instanceof AST_Sequence)) break;
3839 if (merge_jump) value = trim_return(value, merge_jump);
3840 if (value) block.push(make_node(AST_SimpleStatement, value, { body: value }));
3845 if (!mode) return;
3846 if (!value) return;
3861 if (is_declaration(stat)) continue;
3862 if (stat instanceof AST_Var) {
3874 if (stat instanceof AST_Var) continue;
3875 if (is_declaration(stat)) continue;
3882 if (stat instanceof AST_Exit) {
3884 if (mode) {
3887 if (value) return make_node(AST_SimpleStatement, value, { body: value });
3890 } else if (stat instanceof AST_If) {
3892 … if (stat.alternative) stat.alternative = eliminate_returns(stat.alternative, keep_throws);
3893 } else if (stat instanceof AST_LabeledStatement) {
3895 } else if (stat instanceof AST_Try) {
3896 if (!stat.bfinally || !jump.value || jump.value.is_constant()) {
3897 if (stat.bcatch) eliminate_returns(stat.bcatch, keep_throws);
3899 if (trimmed) stat.body.push(trimmed);
3901 …} else if (stat instanceof AST_Block && !(stat instanceof AST_Scope || stat instanceof AST_Switch)…
3903 if (trimmed) stat.body.push(trimmed);
3912 if (self instanceof AST_Catch) {
3914 } else if (self instanceof AST_LabeledStatement) {
3919 if (stat instanceof AST_LoopControl) {
3921 if (loop_body(lct) !== self
3924 } else if (stat.label) {
3930 if (aborts(stat)) {
3936 if (has_quit) has_quit.forEach(function(stat) {
3943 if (!in_lambda || in_try && in_try.bfinally) return;
3947 if (!(stat instanceof AST_SimpleStatement)) break;
3949 if (!(node instanceof AST_Await)) break;
3951 if (!needs_enqueuing(compressor, exp)) break;
3954 if (exp) {
3966 if (in_lambda && index >= 0) {
3969 if (inlined) {
3977 if (!inlined) continue;
3985 if (statements.length < 2) return;
3988 if (!seq.length) return;
3995 if (stat instanceof AST_SimpleStatement) {
3996 if (seq.length >= compressor.sequences_limit) push_seq();
3998 } else if (is_declaration(stat)) {
4011 if (!(block instanceof AST_BlockStatement)) return block;
4015 if (line instanceof AST_Var && declarations_only(line)) {
4017 } else if (stat || is_lexical_definition(line)) {
4030 if (prev) {
4031 if (stat instanceof AST_Exit) {
4032 if (stat.value || !in_async_generator(scope)) {
4035 } else if (stat instanceof AST_For) {
4036 if (!(stat.init instanceof AST_Definitions)) {
4039 if (abort || node instanceof AST_Scope) return true;
4040 if (node instanceof AST_Binary && node.operator == "in") {
4045 if (!abort) {
4046 if (stat.init) stat.init = cons_seq(stat.init);
4054 } else if (stat instanceof AST_ForIn) {
4055 if (!is_lexical_definition(stat.init)) stat.object = cons_seq(stat.object);
4056 } else if (stat instanceof AST_If) {
4058 } else if (stat instanceof AST_Switch) {
4060 } else if (stat instanceof AST_With) {
4064 if (compressor.option("conditionals") && stat instanceof AST_If) {
4068 if (body !== false && alt !== false && decls.length > 0) {
4099 if (body instanceof AST_Assign) return [ body ];
4100 if (body instanceof AST_Sequence) return body.expressions.slice();
4105 if (!exprs) return;
4110 if (!can_trim(expr)) continue;
4112 if (expr.left instanceof AST_SymbolRef) {
4114 } else if (expr.left instanceof AST_PropAccess && can_trim(expr.left.expression)) {
4124 if (tail.length == 0) continue;
4125 if (!trim_assigns(expr.left, expr.right, tail)) continue;
4129 if (defn instanceof AST_Definitions) {
4132 if (!def.value) continue;
4133 if (trim_assigns(def.name, def.value, exprs)) trimmed = true;
4134 if (merge_conditional_assignments(def, exprs, keep)) trimmed = true;
4137 … if (defn instanceof AST_Var && join_var_assign(defn.definitions, exprs, keep)) trimmed = true;
4147 if (!(prev instanceof AST_SimpleStatement)) return;
4148 if (declarations_only(defn)) return;
4150 if (!exprs) return;
4152 if (!join_var_assign(definitions, exprs.reverse(), 0)) return;
4158 if (!compressor.option("conditionals")) return;
4159 if (var_def.name instanceof AST_Destructured) return;
4164 if (!cond) break;
4176 if (!(expr instanceof AST_Assign)) break;
4177 if (expr.operator != "=") break;
4179 if (!(lhs instanceof AST_SymbolRef)) break;
4180 if (is_undeclared_ref(lhs)) break;
4181 if (lhs.scope.resolve() !== scope) break;
4183 if (def.scope !== scope) break;
4184 if (def.orig.length > def.eliminated + 1) break;
4185 if (def.orig[0].TYPE != "SymbolVar") break;
4203 if (value.left instanceof AST_SymbolRef) names.set(value.left.name, true);
4206 if (!(value instanceof AST_Object)) return;
4209 if (!try_join(exprs[0])) break;
4216 if (!(node instanceof AST_Assign)) return;
4217 if (node.operator != "=") return;
4218 if (!(node.left instanceof AST_PropAccess)) return;
4220 if (!(sym instanceof AST_SymbolRef)) return;
4221 if (!names.has(sym.name)) return;
4222 if (!node.right.is_constant_expression(scope)) return;
4224 if (prop instanceof AST_Node) {
4225 if (try_join(prop)) prop = node.left.property = prop.right.clone();
4228 if (prop instanceof AST_Node) return;
4235 if (node instanceof AST_ObjectGetter || node instanceof AST_ObjectSetter) {
4240 if (!all(value.properties, diff)) return;
4254 if (stat instanceof AST_Definitions) {
4255 if (prev && prev.TYPE == stat.TYPE) {
4258 } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) {
4261 } else if (stat instanceof AST_Var) {
4263 if (exprs) {
4264 if (exprs.length) {
4277 } else if (stat instanceof AST_Exit) {
4279 } else if (stat instanceof AST_For) {
4281 if (exprs) {
4284 … } else if (prev instanceof AST_Var && (!stat.init || stat.init.TYPE == prev.TYPE)) {
4285 if (stat.init) {
4293 … } else if (defs && stat.init && defs.TYPE == stat.init.TYPE && declarations_only(stat.init)) {
4297 } else if (stat.init instanceof AST_Var) {
4300 if (exprs) {
4302 if (exprs.length == 0) {
4309 } else if (stat instanceof AST_ForEnumeration) {
4310 if (defs && defs.TYPE == stat.init.TYPE) {
4323 } else if (stat instanceof AST_If) {
4325 } else if (stat instanceof AST_SimpleStatement) {
4327 if (exprs) {
4329 if (!exprs.length) continue;
4331 } else if (prev instanceof AST_Definitions
4339 } else if (stat instanceof AST_Switch) {
4341 } else if (stat instanceof AST_With) {
4351 if (!exprs) return value;
4354 if (exprs[exprs.length - 1] !== tail) exprs.push(tail.left);
4360 if (node instanceof AST_Definitions) {
4361 if (defs === node) return node;
4362 if (defs.TYPE != node.TYPE) return node;
4364 … if (parent instanceof AST_ForEnumeration && parent.init === node) return node;
4365 if (!declarations_only(node)) return node;
4368 if (parent instanceof AST_For && parent.init === node) return null;
4371 if (node instanceof AST_ExportDeclaration) return node;
4372 if (node instanceof AST_Scope) return node;
4373 if (!is_statement(node)) return node;
4383 if (node instanceof AST_DefClass) {
4389 if (node instanceof AST_Definitions) {
4391 if (node.remove_initializers(compressor, defns)) {
4394 if (defns.length > 0) {
4400 if (node instanceof AST_LambdaDefinition) {
4404 if (node instanceof AST_Scope) return true;
4405 if (node instanceof AST_BlockScope) {
4409 if (block.required) {
4411 } else if (block.length) {
4417 if (!(node instanceof AST_LoopControl)) dropped = true;
4419 if (dropped) AST_Node.warn("Dropping unreachable code [{start}]", stat);
4422 if (block) {
4424 if (!safe_to_trim(node)) block.required = true;
4441 // return true if scope executes in Strict Mode
4448 if (!(stat instanceof AST_Directive)) break;
4449 if (stat.value == "use strict") return true;
4452 if (!parent) return compressor.option("module");
4460 // return true if `!!node === true`
4475 if (!fixed) return false;
4486 // return true if the node may represent -0
4509 if (op == "=") return this.right.is_negative_zero();
4526 if (!fixed) return true;
4541 // returns true if this node may be null, undefined or contain `AST_Accessor`
4555 if (op != "=") {
4558 if (!rhs._dot_throw(compressor)) return false;
4559 if (!(sym instanceof AST_SymbolRef)) return true;
4560 if (rhs instanceof AST_Binary && rhs.operator == "||" && sym.name == rhs.left.name) {
4570 if (prop.private) return true;
4571 if (!prop.static) return true;
4580 if (!is_strict(compressor, force)) return false;
4582 if (exp instanceof AST_SymbolRef) exp = exp.fixed_value();
4589 … if (prop instanceof AST_ObjectGetter || prop instanceof AST_ObjectSetter) return false;
4600 if (this.is_undefined) return true;
4601 if (!is_strict(compressor, force)) return false;
4602 if (is_undeclared_ref(this) && this.is_declared(compressor)) return false;
4603 if (this.is_immutable()) return false;
4605 if (is_arguments(def) && !def.scope.rest && all(def.scope.argnames, function(argname) {
4609 if (!fixed) return true;
4611 if (fixed._dot_throw(compressor)) {
4644 if (op == "=") return this.right.is_defined(compressor);
4661 if (this.is_undefined) return false;
4662 if (is_undeclared_ref(this) && this.is_declared(compressor)) return true;
4663 if (this.is_immutable()) return true;
4665 if (!fixed) return false;
4697 if (!compressor.option("unsafe")) return false;
4711 if (!fixed) return false;
4725 // methods to determine if an expression has a numeric result type
4734 if (binary[this.operator]) return true;
4735 if (this.operator != "+") return false;
4783 if (!compressor.option("unsafe")) return false;
4798 if (!fixed) return false;
4799 if (keep_unary
4818 // methods to determine if an expression has a string result type
4824 if (this.left.is_string(compressor)) return true;
4846 if (!compressor.option("unsafe")) return false;
4859 if (!fixed) return false;
4879 if (value instanceof AST_Node) return value.clone(true);
4880 if (Array.isArray(value)) return make_node(AST_Array, orig, {
4885 if (value && typeof value == "object") {
4887 for (var key in value) if (HOP(value, key)) {
4903 if (!compressor.option("global_defs")) return this;
4907 if (!def) return;
4910 if (!(parent instanceof AST_PropAccess)) break;
4911 if (parent.expression !== child) break;
4914 if (is_lhs(child, parent)) {
4926 if (!this.definition().global) return;
4927 if (HOP(compressor.option("global_defs"), this.name)) warn(this);
4930 if (!this.definition().global) return;
4933 if (HOP(defines, name)) return to_node(defines[name], this);
4967 if (!(stat instanceof AST_Directive)) return stat;
4972 if (this.value) return make_node(AST_Return, this.value, { value: this.value });
4984 if (argnames[i] instanceof AST_DefaultValue) break;
4991 if (ev === node) return node;
5083 if (!(node instanceof AST_Dot)) return false;
5085 if (!is_undeclared_ref(expr)) return false;
5106 // If the node has been successfully reduced to a constant,
5117 if (!compressor.option("evaluate")) return this;
5123 if (ignore_side_effects) return val;
5124 if (!val || val instanceof RegExp) return val;
5125 if (typeof val == "function" || typeof val == "object") return this;
5129 if (node instanceof AST_Assign) modified(node.left);
5130 if (node instanceof AST_ForEnumeration) modified(node.init);
5131 … if (node instanceof AST_Unary && UNARY_POSTFIX[node.operator]) modified(node.expression);
5134 if (node instanceof AST_DestructuredArray) {
5136 } else if (node instanceof AST_DestructuredObject) {
5140 } else if (node instanceof AST_PropAccess) {
5142 } else if (node instanceof AST_SymbolRef) {
5160 if (!ignore_side_effects) {
5161 if (!(lhs instanceof AST_SymbolRef)) return this;
5162 if (!HOP(lhs, "_eval")) {
5163 if (!lhs.fixed) return this;
5165 if (!def.fixed) return this;
5166 if (def.undeclared) return this;
5167 if (def.last_ref !== lhs) return this;
5168 if (def.single_use == "m") return this;
5169 if (this.right.has_side_effects(compressor)) return this;
5174 … if (!HOP(lhs, "_eval") && lhs instanceof AST_SymbolRef && lhs.fixed && lhs.definition().fixed) {
5176 } else if (op == "=") {
5187 if (typeof value == "object") return this;
5192 if (!ignore_side_effects) return this;
5202 if (compressor.option("unsafe")) {
5213 if (compressor.option("unsafe")) {
5217 if (element instanceof AST_Hole) return this;
5219 if (element === value) return this;
5227 if (compressor.option("unsafe")) {
5231 if (!(prop instanceof AST_ObjectKeyVal)) return this;
5233 if (key instanceof AST_Node) {
5235 if (key === prop.key) return this;
5244 if (val[key] === prop.value) return this;
5256 if (compressor.option("typeofs")
5264 if (!non_converting_unary[op] && !(def && def.fixed)) depth++;
5267 if (v === e) {
5268 if (ignore_side_effects && op == "void") return;
5276 if (v instanceof RegExp) return this;
5284 if (!def) return this;
5285 if (!ignore_side_effects) {
5286 if (def.undeclared) return this;
5287 if (def.last_ref !== e) return this;
5289 if (HOP(e, "_eval")) v = +(op[0] + 1) + +v;
5297 if (!(e instanceof AST_SymbolRef)) {
5298 if (!ignore_side_effects) return this;
5299 } else if (!HOP(e, "_eval")) {
5300 if (!e.fixed) return this;
5301 if (!ignore_side_effects) {
5303 if (!def.fixed) return this;
5304 if (def.undeclared) return this;
5305 if (def.last_ref !== e) return this;
5308 if (!(e instanceof AST_SymbolRef && e.definition().fixed)) depth++;
5311 if (v === e) return this;
5317 if (!non_converting_binary[this.operator]) depth++;
5319 if (left === this.left) return this;
5320 if (this.operator == (left ? "||" : "&&")) return left;
5323 if (right === this.right) return this;
5354 if (right && typeof right == "object" && HOP(right, left)) {
5361 if (isNaN(result)) return compressor.find_parent(AST_With) ? this : result;
5362 if (compressor.option("unsafe_math")
5369 if (digits < 16) return +result.toFixed(digits);
5380 if (condition === this.condition) return this;
5393 if (found) return true;
5394 if (node === ref) return found = true;
5395 if (node instanceof AST_Scope) return true;
5404 if (!fixed) return this;
5406 if (HOP(fixed, "_eval")) {
5412 if (value === fixed) return this;
5448 if (compressor.option("unsafe")) {
5451 if (!is_undeclared_ref(exp)) {
5453 if (val == null || val === exp) return this;
5456 if (key instanceof AST_Node) {
5458 if (key === this.property) return this;
5460 if (val === undefined) {
5462 if (!static_value || !static_value[key]) return this;
5464 } else if (val instanceof RegExp) {
5465 if (!regexp_props[key]) return this;
5466 } else if (typeof val == "object") {
5467 if (!HOP(val, key)) return this;
5468 } else if (typeof val == "function") switch (key) {
5485 if (node === value) return;
5493 if (fn instanceof AST_Arrow || fn instanceof AST_Defun || fn instanceof AST_Function) {
5494 if (fn.evaluating) return this;
5495 if (fn.name && fn.name.definition().recursive_refs > 0) return this;
5496 if (this.is_expr_pure(compressor)) return this;
5498 if (!all(fn.argnames, function(sym, index) {
5499 if (sym instanceof AST_DefaultValue) {
5500 if (!args) return false;
5501 if (args[index] === undefined) {
5503 if (value === sym.value) return false;
5510 if (fn.rest instanceof AST_Destructured) return this;
5511 if (!args && !ignore_side_effects) return this;
5513 if (!(stat instanceof AST_Return)) {
5514 if (ignore_side_effects) {
5519 if (found) return true;
5520 if (node instanceof AST_Return) {
5521 … if (node.value && node.value._eval(compressor, true, cached, depth) !== undefined) {
5526 if (node instanceof AST_Scope && node !== fn) return true;
5529 if (!found) return;
5534 if (!val) return;
5536 if (!args || all(fn.argnames, function(sym, i) {
5539 if (ignore_side_effects) fn.argnames.forEach(function(sym) {
5540 if (sym instanceof AST_DefaultValue) sym.value.walk(scan_modified);
5550 } else if (compressor.option("unsafe") && exp instanceof AST_PropAccess) {
5552 if (key instanceof AST_Node) {
5554 if (key === exp.property) return this;
5558 if (is_undeclared_ref(e)) {
5560 if (!static_fn || !static_fn[key]) return this;
5564 if (val == null || val === e) return this;
5566 if (!native_fn || !native_fn[key]) return this;
5567 … if (val instanceof RegExp && val.global && !(e instanceof AST_RegExp)) return this;
5570 if (!args) return this;
5571 if (key == "replace" && typeof args[1] == "function") return this;
5577 if (val instanceof RegExp) val.lastIndex = 0;
5583 if (sym instanceof AST_DefaultValue) sym = sym.name;
5585 if (def.orig[def.orig.length - 1] !== sym) return false;
5598 if (!compressor.option("templates")) return this;
5599 if (this.tag) {
5600 if (!is_raw_tag(compressor, this.tag)) return this;
5606 if (!exprs) return this;
5612 if (!malformed) return ret;
5618 if (typeof str != "string") malformed = true;
5636 … if (first_in_statement) return best_of_expression(negated, make_node(AST_SimpleStatement, alt, {
5649 if (compressor.option("unsafe_comps")) {
5693 if (this.operator == "!")
5706 if (compressor.option("unsafe")) {
5708 if (is_undeclared_ref(expr)) {
5709 if (global_pure_fns[expr.name]) return true;
5710 if (this instanceof AST_New && global_pure_constructors[expr.name]) return true;
5712 if (is_static_fn(expr)) return true;
5718 if (!tag) return true;
5719 if (compressor.option("unsafe")) {
5720 if (is_undeclared_ref(tag) && global_pure_fns[tag.name]) return true;
5721 if (tag instanceof AST_Dot && is_undeclared_ref(tag.expression)) {
5731 if (!compressor.option("unsafe")) return false;
5733 if (!(dot instanceof AST_Dot)) return false;
5737 if (exp instanceof AST_Array) {
5739 } else if (exp.is_boolean(compressor)) {
5741 } else if (exp.is_number(compressor)) {
5743 } else if (exp instanceof AST_RegExp) {
5745 } else if (exp.is_string(compressor)) {
5747 if (prop == "replace") {
5749 if (arg && !arg.is_string(compressor)) return false;
5751 } else if (!dot.may_throw_on_access(compressor)) {
5757 // determine if object spread syntax may cause runtime exception
5794 // determine if expression has side effects
5813 if (!(lhs instanceof AST_PropAccess)) return true;
5829 if (!this.is_expr_pure(compressor)
5841 if (base) {
5842 if (base instanceof AST_SymbolRef) base = base.fixed_value();
5843 if (!safe_for_extends(base)) return true;
5933 // determine if expression may throw
5945 if (list[i].may_throw(compressor))
5951 if (exp.may_throw(compressor)) return true;
5952 if (exp instanceof AST_SymbolRef) exp = exp.fixed_value();
5953 if (!(exp instanceof AST_Lambda)) return true;
5954 if (any(exp.argnames, compressor)) return true;
5955 if (any(exp.body, compressor)) return true;
5963 if (this.right.may_throw(compressor)) return true;
5964 if (!compressor.has_directive("use strict")
5983 if (any(this.args, compressor)) return true;
5984 if (this.is_expr_pure(compressor)) return false;
6011 if (this.init.may_throw(compressor)) return true;
6013 if (obj.may_throw(compressor)) return true;
6015 if (!(obj instanceof AST_Array || obj.is_string(compressor))) return true;
6055 if (any(this.expressions, compressor)) return true;
6056 if (this.is_expr_pure(compressor)) return false;
6057 if (!this.tag) return false;
6079 // determine if expression is constant
6083 if (!list[i].is_constant_expression(scope))
6098 if (base && !safe_for_extends(base)) return false;
6110 if (!result) return true;
6111 if (node instanceof AST_BlockScope) {
6112 if (node === self) return;
6118 if (node instanceof AST_SymbolRef) {
6119 if (self.inlined || node.redef || node.in_arg) {
6123 if (self.variables.has(node.name)) return true;
6125 if (member(def.scope, scopes)) return true;
6126 if (scope && !def.redefined()) {
6128 if (scope_def ? scope_def === def : def.undeclared) {
6136 if (node instanceof AST_ObjectIdentity) {
6137 if (is_arrow(self) && all(scopes, function(s) {
6158 // tell me if a statement aborts
6182 if (compressor.option("directives")
6190 if (compressor.option("drop_debugger"))
6196 if (self.body instanceof AST_If || self.body instanceof AST_Break) {
6214 if (!compressor.option("dead_code")) return self;
6216 if (label) {
6219 if (compressor.loopcontrol_target(self) === lct) {
6239 if (!safe_to_trim(stat)) return node;
6240 … if (parent instanceof AST_IterationStatement && stat instanceof AST_LambdaDefinition) return node;
6252 if (!compressor.option("rests")) return;
6253 if (fn.uses_arguments) return;
6254 if (!(fn.rest instanceof AST_DestructuredArray)) return;
6255 if (!compressor.drop_fargs(fn, compressor.parent())) return;
6267 if (!compressor.option("arrows")) return self;
6269 if (self.value) self.body = [ self.first_statement() ];
6274 if (stat instanceof AST_Return) {
6293 if (compressor.option("inline")) for (var i = 0; i < self.body.length; i++) {
6295 if (stat instanceof AST_Directive) continue;
6296 if (stat instanceof AST_Return) {
6297 if (i != self.body.length - 1) break;
6299 if (!call || call.TYPE != "Call") break;
6300 if (call.is_expr_pure(compressor)) break;
6302 if (!(exp instanceof AST_SymbolRef)) {
6304 } else if (self.name && self.name.definition() === exp.definition()) {
6309 if (!(fn instanceof AST_Defun || fn instanceof AST_Function)) break;
6310 if (fn.rest) break;
6311 if (fn.uses_arguments) break;
6312 if (fn === exp) {
6313 if (fn.parent_scope !== self) break;
6314 if (!all(fn.enclosed, function(def) {
6318 if ((fn !== exp || fn.name)
6321 if (fn.contains_this()) break;
6323 if (len > 0 && compressor.option("inline") < 2) break;
6324 if (len > self.argnames.length) break;
6325 if (!all(self.argnames, function(argname) {
6328 if (!all(call.args, function(arg) {
6333 if (!(arg instanceof AST_SymbolRef)) break;
6334 if (arg.definition() !== self.argnames[j].definition()) break;
6336 if (j < len) break;
6338 if (call.args[j].has_side_effects(compressor)) break;
6340 if (j < call.args.length) break;
6341 if (len < self.argnames.length && !compressor.drop_fargs(self, parent)) {
6342 if (!compressor.drop_fargs(fn, call)) break;
6356 if (!compressor.option("merge_vars")) return;
6363 if (node instanceof AST_Assign) {
6366 if (lhs instanceof AST_Destructured) {
6371 if (lazy_op[node.operator.slice(0, -1)]) {
6375 if (lhs instanceof AST_SymbolRef) mark(lhs);
6379 if (lhs instanceof AST_SymbolRef) {
6380 if (node.operator != "=") mark(lhs, true);
6387 if (node instanceof AST_Binary) {
6388 if (!lazy_op[node.operator]) return;
6392 if (node instanceof AST_Break) {
6394 if (!(target instanceof AST_IterationStatement)) insert(target);
6397 if (node instanceof AST_Call) {
6399 if (exp instanceof AST_LambdaExpression) {
6410 if (node instanceof AST_Class) {
6411 if (node.name) node.name.walk(tw);
6412 if (node.extends) node.extends.walk(tw);
6414 if (prop.key instanceof AST_Node) prop.key.walk(tw);
6417 if (prop.static) {
6428 if (node instanceof AST_Conditional) {
6432 if (node instanceof AST_Continue) {
6434 if (target instanceof AST_Do) insert(target);
6437 if (node instanceof AST_Do) {
6443 if (segment.inserted === node) segment = save;
6448 if (node instanceof AST_For) {
6449 if (node.init) node.init.walk(tw);
6453 if (node.condition) node.condition.walk(tw);
6455 if (node.step) node.step.walk(tw);
6459 if (node instanceof AST_ForEnumeration) {
6469 if (node instanceof AST_If) {
6473 if (node instanceof AST_LabeledStatement) {
6478 if (segment.inserted === node) segment = save;
6482 if (node instanceof AST_Scope) {
6485 if (node === self) root = segment;
6486 if (node instanceof AST_Lambda) {
6487 if (node.name) references[node.name.definition().id] = false;
6497 if (node.rest) walk_destructured(AST_SymbolFunarg, marker, node.rest);
6504 if (node instanceof AST_Sub) {
6506 if (node.optional) {
6517 if (node instanceof AST_Switch) {
6521 if (branch instanceof AST_Default) return;
6523 if (save === segment) push();
6531 if (segment.inserted === node) segment = save;
6536 if (node instanceof AST_SymbolConst || node instanceof AST_SymbolLet) {
6540 if (node instanceof AST_SymbolRef) {
6544 if (node instanceof AST_Try) {
6548 if (node.bcatch) {
6549 if (node.bcatch.argname) node.bcatch.argname.mark_symbol(function(node) {
6550 if (node instanceof AST_SymbolCatch) {
6553 if (def = def.redefined()) references[def.id] = false;
6556 if (node.bfinally || (in_try = save_try)) {
6565 if (node.bfinally) node.bfinally.walk(tw);
6568 if (node instanceof AST_Unary) {
6569 if (!UNARY_POSTFIX[node.operator]) return;
6571 if (!(sym instanceof AST_SymbolRef)) return;
6575 if (node instanceof AST_VarDef) {
6577 if (assigned) {
6583 if (node instanceof AST_SymbolVar) {
6589 if (node instanceof AST_SymbolVar) {
6592 if (refs) {
6594 } else if (!(id in references)) {
6603 if (node instanceof AST_While) {
6613 if (!compressor.option("ie")) return;
6615 if (sym instanceof AST_SymbolRef) sym.walk(tw);
6621 if (condition instanceof AST_Binary) switch (condition.operator) {
6632 } else if (condition instanceof AST_Conditional) {
6638 if (consequent) {
6644 if (alternative) {
6659 if (!tail) continue;
6662 if (!tail_refs) continue;
6669 if (tail.index > head.index) continue;
6671 if (!(prev_def.id in prev)) continue;
6673 if (!head_refs) continue;
6674 if (head_refs.start.block !== tail_refs.start.block
6688 if (sym instanceof AST_SymbolRef) {
6696 if (!prev_def.fixed) def.fixed = false;
6701 if (skipped.length) first = skipped.concat(first);
6715 if (node instanceof AST_Destructured) return;
6716 if (node instanceof AST_DefaultValue) {
6721 } else if (node instanceof AST_DestructuredKeyVal) {
6722 if (!(node.key instanceof AST_Node)) {
6724 } else if (node.value instanceof AST_PropAccess) {
6734 } else if (node instanceof symbol_type) {
6746 if (read && !all(in_arg, function(fn) {
6748 if (!ldef) return true;
6749 if (!is_funarg(ldef)) return true;
6755 if (in_try) {
6760 if (def.id in references) {
6762 if (!refs) return;
6763 if (refs.start.block !== seg.block) return references[def.id] = false;
6766 if (def.id in prev) {
6768 } else if (!read) {
6771 } else if ((ldef = self.variables.get(def.name)) !== def) {
6772 if (ldef && root === seg) references[ldef.id] = false;
6774 } else if (compressor.exposed(def) || NO_MERGE[sym.name]) {
6781 if (!read) {
6788 if (seg.block !== self) return references[def.id] = false;
6801 if (scope !== sym.scope) push_uniq(refs.scopes, scope);
6808 if (HOP(segment, "block")) {
6810 if (block instanceof AST_LabeledStatement) block = block.body;
6811 if (block === target) break;
6821 if (HOP(seg, "block")) segment.block = seg.block;
6822 if (HOP(seg, "loop")) segment.loop = seg.loop;
6837 if (!elements[i]) elements[i] = make_node(AST_Hole, orig);
6843 if (cl.name) cl.name = drop_name ? null : make_node(AST_SymbolClass, cl.name);
6869 if (!compressor.option("unused")) return;
6875 if (node instanceof AST_Assign) {
6876 … if (node.write_only || node.operator == "=") sym = extract_reference(node.left, props);
6877 } else if (node instanceof AST_Unary) {
6878 if (node.write_only) sym = extract_reference(node.expression, props);
6880 if (!(sym instanceof AST_SymbolRef)) return;
6882 if (export_defaults[def.id]) return;
6883 if (compressor.exposed(def)) return;
6884 if (!can_drop_symbol(sym, compressor, nested)) return;
6888 if (node instanceof AST_PropAccess) {
6890 if (!expr.may_throw_on_access(compressor, true)) {
6892 if (props && node instanceof AST_Sub) props.unshift(node.property);
6895 } else if (node instanceof AST_Assign && node.operator == "=") {
6898 if (!props) return ref;
6913 if (!parent) return find;
6917 if (def) return def;
6919 if (def) {
6921 … if (sym instanceof AST_SymbolFunarg || sym instanceof AST_SymbolLambda) return def;
6935 if (self instanceof AST_Toplevel && compressor.top_retain) {
6937 if (compressor.top_retain(def) && !(def.id in in_use_ids)) {
6950 … if (node instanceof AST_Lambda && node.uses_arguments && !tw.has_directive("use strict")) {
6953 if (!(def.id in in_use_ids)) {
6959 if (node === self) return;
6960 if (scope === self) {
6961 if (node instanceof AST_DefClass) {
6964 if (!drop && !(def.id in in_use_ids)) {
6969 if (used) {
6971 } else if (drop && !(def.id in lambda_ids)) {
6974 if (node.extends) node.extends.walk(tw);
6977 if (prop.key instanceof AST_Node) prop.key.walk(tw);
6979 if (!value) return;
6980 if (is_static_field_or_init(prop)) {
6981 if (!used && value.contains_this()) used = true;
6992 if (node instanceof AST_LambdaDefinition) {
6995 if (!drop && !(def.id in in_use_ids)) {
7000 if (tw.parent() instanceof AST_ExportDefault) {
7004 if (drop && !(def.id in lambda_ids)) lambda_ids[def.id] = 1;
7007 if (node instanceof AST_Definitions) {
7014 if (!(name instanceof AST_SymbolDeclaration)) return;
7017 if (node instanceof AST_Var && def.orig[0] instanceof AST_SymbolCatch) {
7019 if (redef) var_defs[redef.id] = (var_defs[redef.id] || 0) + 1;
7021 if (!(def.id in in_use_ids) && (!drop_vars || def.exported
7027 if (value) {
7028 if (!side_effects) {
7030 } else if (shared) {
7038 if (side_effects) value.walk(tw);
7042 if (node instanceof AST_SymbolFunarg) {
7048 if (node instanceof AST_SymbolImport) {
7050 if (!(def.id in in_use_ids) && (!drop_vars || !is_safe_lexical(def))) {
7071 if (!(def.id in in_use_ids)) return true;
7072 if (def.orig.length - def.eliminated < 2) return false;
7074 if (def.orig[1] instanceof AST_SymbolFunarg) return true;
7075 // retain if referenced within destructured object of argument
7080 if (compressor.option("ie")) initializations.each(function(init, id) {
7081 if (id in in_use_ids) return;
7084 … if (node instanceof AST_Function && node.name && !drop_fn_name(node.name.definition())) {
7088 if (node instanceof AST_Scope) return true;
7093 // initialization code to figure out if it uses other
7098 if (init) init.forEach(function(init) {
7104 if (!assigns) {
7118 if (assign === node) return true;
7119 if (assign instanceof AST_Unary) return false;
7123 if (assigns.length == in_use.length) {
7133 if (node instanceof AST_DefaultValue) return trim_default(trimmer, node);
7134 … if (node instanceof AST_Destructured && node.rest) node.rest = node.rest.transform(trimmer);
7135 if (node instanceof AST_DestructuredArray) {
7139 if (element) {
7142 } else if (trim) {
7150 if (node instanceof AST_DestructuredObject) {
7154 if (prop.key instanceof AST_Node) {
7158 if ((retain || node.rest) && is_decl(prop.value)) {
7163 if (!value && node.rest) {
7164 if (prop.value instanceof AST_DestructuredArray) {
7170 if (value) {
7179 if (node instanceof AST_SymbolDeclaration) return trim_decl(node);
7183 if (drop_vars) {
7185 if (sym) {
7187 if (can_drop_lhs(sym, node)) {
7188 if (node instanceof AST_Assign) {
7190 … if (node.write_only === true) value = value.drop_side_effect_free(compressor);
7192 if (!value) value = make_node(AST_Number, node, { value: 0 });
7194 if (value) {
7195 if (props.assign) {
7197 if (assign) {
7202 if (!(parent instanceof AST_Sequence)
7218 } else if (node instanceof AST_UnaryPostfix
7227 if (node instanceof AST_Binary && node.operator == "instanceof") {
7229 if (!(sym instanceof AST_SymbolRef)) return;
7230 if (sym.definition().id in in_use_ids) return;
7235 if (node instanceof AST_Call) {
7243 if (scope !== self) return;
7244 if (drop_funcs && node !== self && node instanceof AST_DefClass) {
7246 if (!(def.id in in_use_ids)) {
7251 if (parent instanceof AST_ExportDefault) return trimmed;
7253 if (trimmed) return make_node(AST_SimpleStatement, node, { body: trimmed });
7257 … if (node instanceof AST_ClassExpression && node.name && drop_fn_name(node.name.definition())) {
7260 if (node instanceof AST_Lambda) {
7261 if (drop_funcs && node !== self && node instanceof AST_LambdaDefinition) {
7263 if (!(def.id in in_use_ids)) {
7266 if (parent instanceof AST_ExportDefault) {
7274 … if (node instanceof AST_LambdaExpression && node.name && drop_fn_name(node.name.definition())) {
7277 if (!(node instanceof AST_Accessor)) {
7279 if (trim && parent instanceof AST_Call && parent.expression === node) {
7282 if (args[spread] instanceof AST_Spread) break;
7288 if (rest) {
7290 if (!args || spread < argnames.length || rest instanceof AST_SymbolFunarg) {
7298 … if (trimmed.value.elements.length) [].push.apply(args, trimmed.value.elements);
7300 if (rest instanceof AST_Destructured && !rest.rest) {
7301 if (rest instanceof AST_DestructuredArray) {
7302 if (rest.elements.length == 0) rest = null;
7303 } else if (rest.properties.length == 0) {
7308 if (rest) {
7317 if (sym instanceof AST_SymbolFunarg) {
7319 if (def.id in in_use_ids) {
7321 if (indexOf_assign(def, sym) < 0) sym.unused = null;
7322 } else if (trim) {
7333 if (!args || spread < i) {
7338 if (trimmed.value) args[i] = trimmed.value;
7340 if (funarg) {
7343 if (!after) after = !(funarg instanceof AST_SymbolFunarg);
7344 } else if (trim) {
7347 } else if (i > default_length) {
7349 if (sym.name instanceof AST_SymbolFunarg) {
7363 … if (before && !after && node.uses_arguments && !tt.has_directive("use strict")) {
7370 if (node instanceof AST_Catch && node.argname instanceof AST_Destructured) {
7373 …if (node instanceof AST_Definitions && !(parent instanceof AST_ForEnumeration && parent.init === n…
7383 if (def.value) def.value = def.value.transform(tt);
7385 if (def.name instanceof AST_Destructured) {
7387 if (!drop_vars) return node;
7388 if (node.definition().id in in_use_ids) return node;
7389 if (is_catch(node)) return node;
7390 if (is_var && !can_drop_symbol(node)) return node;
7393 if (trimmed.name) {
7399 } else if (trimmed.value) {
7406 if (!drop_sym || !drop_vars || sym.id in in_use_ids) {
7408 … if (value && ((index = indexOf_assign(sym, def)) < 0 || self_assign(value.tail_node()))) {
7411 … if (value) AST_Node.warn("Side effects in definition of variable {name} [{start}]", def.name);
7412 if (node instanceof AST_Const) {
7416 if (value) side_effects.push(value);
7419 if (index >= 0) assign_in_use[sym.id][index] = def;
7422 if (!value && !(node instanceof AST_Let)) {
7423 if (parent instanceof AST_ExportDeclaration) {
7425 } else if (drop_sym && var_defs[sym.id] > 1) {
7432 } else if (compressor.option("functions")
7463 if (old_def) old_def.forEach(function(node) {
7469 … if (value !== fn) [].push.apply(side_effects, value.expressions.slice(0, -1));
7471 if (drop_sym
7480 } else if (is_catch(def.name)) {
7482 if (value) side_effects.push(value);
7483 if (var_defs[sym.id] > 1) {
7493 if (value) {
7507 if (refs.length == 0) return fn === def.name.fixed_value();
7514 … if (!is_var || compressor.has_directive("use strict") || !(fn instanceof AST_Function)) {
7523 if (!fn.name) return null;
7525 if (def.orig.length > 1) return null;
7526 if (def.assignments > 0) return false;
7527 if (def.name == name) return def;
7528 if (compressor.option("keep_fnames")) return false;
7540 if (scope.find_variable(name) !== sym) return false;
7541 if (forbidden) do {
7543 if (forbidden(scope)) return false;
7555 if (side_effects.length > 0) {
7556 if (tail.length == 0) {
7560 } else if (value) {
7576 if (tail.length == 0) break;
7577 if (tail.length == duplicated) {
7589 if (index >= 0) assign_in_use[sym.id][index] = assign;
7597 if (tail.length == 0) {
7599 if (id in for_ins) {
7607 if (tail.length > 0 && (seq = tail[0].value) instanceof AST_Sequence) {
7616 if (side_effects.length > 0) {
7621 if (node instanceof AST_Assign) {
7623 if (!(node.left instanceof AST_Destructured)) return node;
7627 if (trimmed.name) return make_node(AST_Assign, node, {
7632 if (trimmed.value) return trimmed.value;
7633 if (parent instanceof AST_Sequence && parent.tail_node() !== node) return List.skip;
7636 if (node instanceof AST_LabeledStatement && node.body instanceof AST_For) {
7641 if (node.body instanceof AST_BlockStatement) {
7649 if (node instanceof AST_Scope) {
7653 if (node instanceof AST_SymbolImport) {
7654 … if (!compressor.option("imports") || node.definition().id in in_use_ids) return node;
7665 if (node instanceof AST_BlockStatement) return trim_block(node, tt.parent(), in_list);
7666 if (node instanceof AST_ExportDeclaration) {
7668 if (!(block instanceof AST_BlockStatement)) return;
7673 if (node instanceof AST_For) return patch_for_init(node, in_list);
7674 if (node instanceof AST_ForIn) {
7675 if (!drop_vars || !compressor.option("loops")) return;
7676 if (!is_empty(node.body)) return;
7678 if (!sym) return;
7680 if (def.id in in_use_ids) return;
7682 if (for_ins[def.id] === node) delete for_ins[def.id];
7685 if (value) {
7689 … if (node.init instanceof AST_Definitions && def.orig[0] instanceof AST_SymbolCatch) {
7694 if (node instanceof AST_Import) {
7695 if (node.properties && node.properties.length == 0) node.properties = null;
7698 if (node instanceof AST_Sequence) {
7699 if (node.expressions.length > 1) return;
7706 if (self instanceof AST_Lambda
7721 if (node.name instanceof AST_SymbolFunarg) {
7744 if (def.scope.resolve() !== self) return false;
7745 if (!def.fixed || !node.fixed) assign_in_use[def.id] = false;
7750 if (!assign_in_use[def.id]) assign_in_use[def.id] = [];
7751 if (node.fixed.assigns) push_uniq(assign_in_use[def.id], node.fixed.assigns);
7760 if (lambda_ids[def.id] > 1 && !(def.id in in_use_ids)) {
7768 if (def.id in in_use_ids) return;
7769 if (read && modified) {
7781 if (!in_use) return true;
7782 if (node[node instanceof AST_Assign ? "left" : "expression"] !== sym) return false;
7788 if (!assign.write_only) return rhs;
7789 if (!(rhs instanceof AST_Binary && lazy_op[rhs.operator])) return rhs;
7790 if (!(rhs.left instanceof AST_SymbolRef)) return rhs;
7791 if (!(assign.left instanceof AST_SymbolRef)) return rhs;
7793 if (rhs.left.definition() !== def) return rhs;
7794 if (rhs.right.has_side_effects(compressor)) return rhs;
7795 if (track_assigns(def, rhs.left)) add_assigns(def, rhs.left);
7801 if (init instanceof AST_Definitions) {
7806 if (init instanceof AST_SymbolRef) return init;
7810 if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef) {
7812 if (def.scope.resolve() === self) assignments.add(def.id, node);
7814 if (node instanceof AST_SymbolRef && node.in_arg) var_defs[node.definition().id] = 0;
7815 if (node instanceof AST_Unary && node.expression instanceof AST_SymbolRef) {
7817 if (def.scope.resolve() === self) assignments.add(def.id, node);
7820 if (sym) {
7822 … if (node_def.scope.resolve() !== self && self.variables.get(sym.name) !== node_def) return;
7823 if (is_arguments(node_def) && !all(self.argnames, function(argname) {
7825 if (node instanceof AST_SymbolFunarg) {
7831 … if (node.write_only === "p" && node.right.may_throw_on_access(compressor, true)) return;
7833 if (assign) {
7840 if (node instanceof AST_Assign) {
7842 if (init && node.write_only === true && !right.has_side_effects(compressor)) {
7848 if (node.left === sym) {
7849 if (!node.write_only || shared) {
7854 if (!fixed || !fixed.is_constant()) {
7859 … if (track_assigns(node_def, sym) && is_lhs(sym, node) !== sym) add_assigns(node_def, sym);
7863 if (node instanceof AST_Binary) {
7864 if (node.operator != "instanceof") return;
7866 if (!(sym instanceof AST_SymbolRef)) return;
7868 if (!lambda_ids[id]) return;
7873 if (node instanceof AST_ForIn) {
7874 if (node.init instanceof AST_SymbolRef && scope === self) {
7876 if (!(id in for_ins)) for_ins[id] = node;
7878 if (!drop_vars || !compressor.option("loops")) return;
7879 if (!is_empty(node.body)) return;
7880 if (node.init.has_side_effects(compressor)) return;
7882 if (!sym) return;
7884 if (def.scope.resolve() !== self) {
7886 if (d === def || d && d.redefined() === def) return;
7891 if (node instanceof AST_SymbolRef) {
7893 if (!(node_def.id in in_use_ids)) {
7897 if (cross_scope(node_def.scope, node.scope)) {
7899 if (redef && !(redef.id in in_use_ids)) {
7904 if (track_assigns(node_def, node)) add_assigns(node_def, node);
7907 if (node instanceof AST_Scope) {
7921 if (node.definition().id in in_use_ids) return node;
7922 if (node instanceof AST_SymbolFunarg) node.unused = true;
7929 if (!name) {
7930 if (node.name instanceof AST_Destructured) return null;
7932 if (!value) return null;
7943 if (node instanceof AST_DefaultValue) {
7944 … if (!(compressor.option("default_values") && value && value.is_defined(compressor))) {
7949 … if (!trimmed && drop && value) value = value.drop_side_effect_free(compressor);
7951 } else if (node === root) {
7957 if (node instanceof AST_DestructuredArray) {
7960 if (value instanceof AST_SymbolRef) {
7965 if (value instanceof AST_Array) {
7975 if (value instanceof AST_Hole) {
7977 } else if (value instanceof AST_Spread) {
7978 if (drop) {
7987 if (element) elements[pos] = element;
7988 if (drop && value) newValues[pos] = value;
7989 if (element || value || !drop || !values) pos++;
7994 if (node.rest) {
7999 if (node.rest) elements.length = pos;
8001 if (drop) {
8002 if (value && !node.rest) value = value.drop_side_effect_free(compressor);
8003 if (value instanceof AST_Array) {
8005 } else if (value instanceof AST_Sequence) {
8007 } else if (value) {
8010 if (value && value.length) {
8017 if (values && newValues) {
8022 if (!native) {
8024 } else if (!node.rest) switch (elements.length) {
8026 if (node === root) break;
8027 if (drop) value = value.drop_side_effect_free(compressor);
8030 if (!drop) break;
8031 if (node === root) break;
8033 if (sym.has_side_effects(compressor)) break;
8034 if (value.has_side_effects(compressor) && sym.match_symbol(function(node) {
8047 if (node instanceof AST_DestructuredObject) {
8050 if (value instanceof AST_SymbolRef) {
8055 if (value instanceof AST_Object) {
8060 if (prop instanceof AST_Spread) {
8064 if (key instanceof AST_Node) key = key.evaluate(compressor, true);
8065 if (key instanceof AST_Node) {
8067 } else if (prop_map && !(prop instanceof AST_ObjectSetter)) {
8075 if (node.rest) {
8084 if (key instanceof AST_Node) {
8088 if (key instanceof AST_Node) {
8096 if (key instanceof AST_Node) {
8103 if (mapped) {
8105 if (value instanceof AST_Accessor) value = false;
8110 if (!trimmed) {
8111 if (node.rest || retain_key(prop)) trimmed = retain_lhs(prop.value);
8112 if (drop_keys && !drop_keys.has(key)) {
8113 if (mapped) {
8115 if (value === null) {
8125 } else if (drop_keys) {
8128 if (value) mapped.value = value;
8130 if (trimmed) {
8137 if (drop_keys && prop_keys) {
8140 if (prop instanceof AST_Spread) return prop;
8142 if (key instanceof AST_Node) return prop;
8143 if (drop_keys.has(key)) {
8145 if (!mapped) return prop;
8146 if (mapped === prop) return prop_map.get(key) || List.skip;
8147 } else if (node.rest) {
8151 if (trimmed) {
8161 if (value && !node.rest) switch (properties.length) {
8163 if (node === root) break;
8164 if (value.may_throw_on_access(compressor, true)) break;
8165 if (drop) value = value.drop_side_effect_free(compressor);
8168 if (!drop) break;
8169 if (node === root) break;
8171 if (prop.key instanceof AST_Node) break;
8172 if (prop.value.has_side_effects(compressor)) break;
8173 … if (value.has_side_effects(compressor) && prop.value.match_symbol(function(node) {
8185 if (node instanceof AST_Hole) {
8190 if (!node && drop && value) value = value.drop_side_effect_free(compressor);
8203 if (node instanceof AST_Assign) {
8206 } else if (node instanceof AST_Binary) {
8207 if (!lazy_op[node.operator]) return;
8210 } else if (node instanceof AST_Conditional) {
8213 } else if (node instanceof AST_Sequence) {
8215 } else if (node instanceof AST_Unary) {
8221 if (node instanceof AST_DefaultValue) return retain_lhs(node.name);
8222 if (node instanceof AST_Destructured) {
8223 if (value === null) {
8225 } else if (value) {
8226 if (value.may_throw_on_access(compressor, true)) {
8243 if (compressor.has_directive("use asm")) return;
8247 if (hoist_vars) {
8249 // space if we hoist `var` when there's only one.
8252 if (var_decl > 1) return true;
8253 if (node instanceof AST_ExportDeclaration) return true;
8254 if (node instanceof AST_Scope && node !== self) return true;
8255 if (node instanceof AST_Var) {
8260 if (var_decl <= 1) hoist_vars = false;
8262 if (!hoist_funs && !hoist_vars) return;
8268 if (node === self) return;
8269 if (node instanceof AST_Directive) {
8273 if (node instanceof AST_LambdaDefinition) {
8274 if (!hoist_funs) return node;
8276 if (p instanceof AST_ExportDeclaration) return node;
8277 if (p instanceof AST_ExportDefault) return node;
8278 if (p !== self && compressor.has_directive("use strict")) return node;
8282 if (node instanceof AST_Var) {
8283 if (!hoist_vars) return node;
8285 if (p instanceof AST_ExportDeclaration) return node;
8286 if (!all(node.definitions, function(defn) {
8296 if (p instanceof AST_ForEnumeration && p.init === node) {
8297 if (seq) return seq;
8301 if (p instanceof AST_For && p.init === node) return seq;
8302 if (!seq) return in_list ? List.skip : make_node(AST_EmptyStatement, node);
8305 if (node instanceof AST_Scope) return node;
8306 if (node instanceof AST_SymbolConst) {
8312 if (vars.size() > 0) {
8315 if (self instanceof AST_Lambda) self.each_argname(function(argname) {
8316 if (all(argname.definition().references, function(ref) {
8328 if (defns.length > 0) hoisted.push(make_node(AST_Var, self, { definitions: defns }));
8335 if (node instanceof AST_Return) {
8339 if (node instanceof AST_Scope && node !== fn) return true;
8347 if (value) value = value.tail_node();
8348 if (value instanceof AST_SymbolRef) {
8357 if (compressor.exposed(def)) return false;
8370 if (value) {
8372 if (!ev) {
8378 } else if (!(ev instanceof AST_Node)) {
8391 if (!compressor.option("booleans")) return;
8392 if (compressor.parent() instanceof AST_ExportDefault) return;
8403 if (!compressor.option("booleans")) return;
8406 if (this.name && !can_trim(this.name.definition())) return;
8408 if (parent instanceof AST_Assign) {
8409 if (parent.operator != "=") return;
8411 if (!(sym instanceof AST_SymbolRef)) return;
8412 if (!can_trim(sym.definition())) return;
8413 } else if (parent instanceof AST_Call && parent.expression !== this) {
8415 if (exp instanceof AST_SymbolRef) exp = exp.fixed_value();
8416 if (!(exp instanceof AST_Lambda)) return;
8417 if (exp.uses_arguments || exp.pinned()) return;
8421 if (arg === this) {
8423 if (!sym && exp.rest) return;
8426 if (arg instanceof AST_Spread) return;
8428 if (sym instanceof AST_DefaultValue) sym = sym.name;
8429 if (sym instanceof AST_SymbolFunarg && !can_trim(sym.definition())) return;
8430 } else if (parent.TYPE == "Call") {
8443 if (drop) {
8461 if (!var_names) {
8475 … if (orig instanceof AST_SymbolDeclaration) orig.definition().references.forEach(function(ref) {
8478 if (!push_uniq(scopes, s)) return;
8500 if (!compressor.option("hoist_props") || compressor.has_directive("use asm")) return;
8502 if (is_arrow(self) && self.value) return;
8506 if (node instanceof AST_Assign) {
8507 if (node.operator != "=") return;
8508 if (!node.write_only) return;
8509 if (!can_hoist(node.left, node.right, 1)) return;
8539 if (node instanceof AST_Scope) {
8540 if (node === self) return;
8542 if (parent.TYPE == "Call" && parent.expression === node) return;
8545 if (node instanceof AST_VarDef) {
8546 if (!can_hoist(node.name, node.value, 0)) return;
8572 if (node instanceof AST_PropAccess) {
8573 if (!(node.expression instanceof AST_SymbolRef)) return;
8575 if (!defs) return;
8576 if (node.expression.fixed_value() !== defs.value) return;
8586 if (node instanceof AST_SymbolRef) {
8588 if (!defs) return;
8589 if (node.fixed_value() !== defs.value) return;
8595 if (!(sym instanceof AST_Symbol)) return;
8597 if (def.assignments != count) return;
8598 if (def.references.length - def.replaced == count) return;
8599 if (def.single_use) return;
8600 if (self.find_variable(sym.name) !== def) return;
8601 if (top_retain(def)) return;
8602 if (sym.fixed_value() !== right) return;
8604 if (fixed.direct_access) return;
8605 if (fixed.escaped && fixed.escaped.depth == 1) return;
8616 if (!fn.name || !compressor.option("ie")) return true;
8618 if (compressor.exposed(def)) return false;
8625 if (!(exp instanceof AST_Lambda)) return;
8630 if (arrow && compressor.option("arrows")) {
8631 if (!exp.value) {
8633 } else if (!async || needs_enqueuing(compressor, exp.value)) {
8635 if (dropped !== exp.value) {
8640 } else if (!is_generator(exp)) {
8641 if (!ignore_name && exp.name) {
8648 if (drop_body) {
8651 if (value) {
8652 if (async && !needs_enqueuing(compressor, value)) return node;
8656 if (!value) return make_node(AST_EmptyStatement, node);
8661 if (value) {
8662 if (async && !needs_enqueuing(compressor, value)) return;
8664 if (dropped !== value) {
8666 if (dropped && async && !needs_enqueuing(compressor, dropped)) {
8674 if (async && compressor.option("awaits")) {
8675 if (drop_body) exp.process_expression("awaits", function(node) {
8677 if (body instanceof AST_Await) {
8678 if (needs_enqueuing(compressor, body.expression)) {
8681 if (!body) return make_node(AST_EmptyStatement, node);
8684 } else if (body instanceof AST_Sequence) {
8688 if (!(tail instanceof AST_Await)) break;
8690 if (!needs_enqueuing(compressor, value)) break;
8692 if (exprs[i] = value.drop_side_effect_free(compressor)) break;
8709 if (abort) return true;
8710 if (tw.parent() === exp && node.may_throw(compressor)) return abort = true;
8711 if (node instanceof AST_Await) return abort = true;
8712 if (node instanceof AST_ForAwaitOf) return abort = true;
8713 if (node instanceof AST_Return) {
8714 if (node.value && !needs_enqueuing(compressor, node.value)) return abort = true;
8717 if (node instanceof AST_Scope && node !== exp) return true;
8720 if (!abort) {
8744 // if all elements were dropped. Note: original array may be
8745 // returned if nothing changed.
8752 if (spread && node instanceof AST_Spread) {
8757 if (trimmed !== node) changed = true;
8758 if (trimmed) {
8767 if (!exp.is_string(compressor)) return node;
8777 if (!values) return null;
8778 if (values === this.elements && all(values, function(node) {
8785 if (left instanceof AST_PropAccess) {
8787 if (expr.may_throw_on_access(compressor, true)) return this;
8788 if (compressor.has_directive("use strict") && expr.is_constant()) return this;
8790 if (left.has_side_effects(compressor)) return this;
8791 if (lazy_op[this.operator.slice(0, -1)]) return this;
8793 … if (!root_expr(left).is_constant_expression(compressor.find_parent(AST_Scope))) return this;
8797 if (!compressor.option("awaits")) return this;
8799 if (!needs_enqueuing(compressor, exp)) return this;
8800 if (exp instanceof AST_UnaryPrefix && exp.operator == "!") exp = exp.expression;
8802 if (dropped === exp) return this;
8803 if (!dropped) {
8805 } else if (!needs_enqueuing(compressor, dropped)) {
8816 if (!can_drop_op(op, right, compressor)) {
8818 if (lhs === left) return this;
8824 if (!rhs) return left.drop_side_effect_free(compressor, first_in_statement);
8825 if (lazy_op[op] && rhs.has_side_effects(compressor)) {
8827 if (rhs !== right) {
8831 if (op == "??") return node;
8836 …if (negated_rhs instanceof AST_Binary && negated.operator == negated_rhs.operator) swap_chain(nega…
8841 if (!lhs) return rhs;
8843 if (!rhs) return lhs;
8858 if (self.is_expr_pure(compressor)) {
8859 if (self.pure) AST_Node.warn("Dropping __PURE__ call [{start}]", self);
8864 if (self.is_call_pure(compressor)) {
8870 if (compressor.option("yields") && is_generator(exp)) {
8875 if (opt !== call) return opt.drop_side_effect_free(compressor, first_in_statement);
8878 if (dropped) {
8883 if (exp._squeezed) self.expression._squeezed = true;
8885 if (self instanceof AST_New) {
8887 if (fn instanceof AST_SymbolRef) fn = fn.fixed_value();
8888 if (fn instanceof AST_Lambda) {
8889 if (assign_this_only(fn, compressor)) {
8895 if (!fn.contains_this()) {
8911 if (prop.key instanceof AST_Node) exprs.push(prop.key);
8912 if (!is_static_field_or_init(prop)) continue;
8914 if (!value.has_side_effects(compressor)) continue;
8915 if (value.contains_this()) return self;
8916 if (prop instanceof AST_ClassInit) {
8924 if (base) {
8925 if (base instanceof AST_SymbolRef) base = base.fixed_value();
8927 if (!base) exprs.unshift(self.extends);
8930 if (exprs) first_in_statement = false;
8932 if (!exprs) {
8933 if (!base && !values && !self.name) return null;
8936 if (base || self.name || !compressor.has_directive("use strict")) {
8938 if (!base) node.extends = null;
8940 if (values) {
8941 if (values.length == init) {
8942 if (exprs.length) values.unshift(make_node(AST_ClassField, self, {
8952 } else if (exprs.length) node.properties.push(make_node(AST_ClassMethod, self, {
8961 if (values) exprs.push(make_node(AST_Call, self, {
8973 if (!(node instanceof AST_ClassInit)) return node;
8986 if (consequent === this.consequent && alternative === this.alternative) return this;
8988 if (compressor.option("ie")) {
8990 if (consequent instanceof AST_Function) {
8994 if (alternative instanceof AST_Function) {
9000 if (!consequent) {
9006 } else if (!alternative) {
9017 if (!exprs) return node;
9018 if (node) exprs.push(node);
9024 if (expr.may_throw_on_access(compressor)) return this;
9034 if (prop instanceof AST_Spread) {
9037 if (prop.key instanceof AST_Node) exprs.push(prop.key);
9045 if (!values) return null;
9046 if (values === exprs && !all(values, function(node) {
9056 if (!expressions) return null;
9059 …if (compressor.option("awaits") && end > 0 && last instanceof AST_Await && last.expression.is_cons…
9067 if (compressor.option("conditionals")
9082 if (expr.may_throw_on_access(compressor)) return this;
9085 if (!expr) return prop.drop_side_effect_free(compressor, first_in_statement);
9087 if (!prop) return expr;
9095 if (self.is_expr_pure(compressor)) {
9097 if (expressions.length == 0) return null;
9102 if (dropped) {
9107 if (tag._squeezed) self.tag._squeezed = true;
9113 if (unary_side_effects[this.operator]) {
9117 …if (this.operator == "typeof" && exp instanceof AST_SymbolRef && can_drop_symbol(exp, compressor))…
9121 if (first_in_statement && node && is_iife_call(node)) {
9122 if (node === exp && this.operator == "!") return this;
9132 if (compressor.option("side_effects")) {
9135 if (!node) {
9139 if (node !== body) {
9151 if (!type) type = AST_LoopControl;
9154 if (found || node instanceof AST_Scope) return true;
9155 if (node instanceof type && tw.loopcontrol_target(node) === loop) {
9159 if (parent instanceof AST_LabeledStatement) tw.push(parent);
9166 if (!compressor.option("loops")) return self;
9168 if (!(cond instanceof AST_Node)) {
9169 …if (cond && !has_loop_control(self, compressor.parent(), AST_Continue)) return make_node(AST_For, …
9177 …if (!has_loop_control(self, compressor.parent())) return make_node(AST_BlockStatement, self.body, {
9184 …if (self.body instanceof AST_BlockStatement && !has_loop_control(self, compressor.parent(), AST_Co…
9188 if (stat instanceof AST_If
9192 if (has_block_scope_refs(stat.condition)) break;
9199 } else if (stat instanceof AST_SimpleStatement) {
9200 if (has_block_scope_refs(stat.body)) break;
9206 } else if (!is_declaration(stat, true)) {
9212 … if (self.body instanceof AST_EmptyStatement) return make_node(AST_For, self).optimize(compressor);
9213 if (self.body instanceof AST_SimpleStatement) return make_node(AST_For, self, {
9225 if (found) return true;
9226 if (node instanceof AST_SymbolRef) {
9227 if (!member(node.definition(), self.enclosed)) found = true;
9237 if (compressor.option("dead_code")
9242 if (is_statement(self.init)) {
9244 } else if (self.init) {
9248 if (self.condition && retain) {
9254 } else if (self.condition) {
9256 } else if (retain) {
9262 if (first instanceof AST_If) {
9264 if (ab instanceof AST_Break && !external_target(ab)) {
9265 if (self.condition) {
9279 if (ab instanceof AST_Break && !external_target(ab)) {
9280 if (self.condition) {
9305 if (self.body instanceof AST_BlockStatement) {
9317 if (!compressor.option("loops")) return self;
9318 if (compressor.option("side_effects")) {
9319 if (self.init) self.init = self.init.drop_side_effect_free(compressor);
9320 if (self.step) self.step = self.step.drop_side_effect_free(compressor);
9322 if (self.condition) {
9324 if (!cond) {
9325 if (compressor.option("dead_code")) {
9327 if (is_statement(self.init)) {
9329 } else if (self.init) {
9336 } else if (!(cond instanceof AST_Node)) {
9350 if (compressor.option("varify") && is_lexical_definition(self.init)) {
9352 if ((name instanceof AST_Destructured || name instanceof AST_SymbolLet)
9354 if (node instanceof AST_SymbolDeclaration) {
9366 if (condition instanceof AST_Sequence) condition = condition.tail_node();
9367 if (!(condition instanceof AST_Binary)) return;
9368 if (!(condition.left instanceof AST_String)) {
9381 if (!(condition.right instanceof AST_UnaryPrefix)) return;
9382 if (condition.right.operator != "typeof") return;
9384 if (!is_undeclared_ref(sym)) return;
9397 if (!body) return;
9404 if (abort) return true;
9405 if (node instanceof AST_Assign) {
9407 if (!(ref instanceof AST_SymbolRef && ref.definition() === def)) return;
9416 if (node instanceof AST_Call) {
9420 if (fn instanceof AST_SymbolRef) {
9424 if (!(fn instanceof AST_Lambda)) {
9426 } else if (push_uniq(scanned, fn)) {
9429 if (save >= 0) refs.length = save;
9432 if (node instanceof AST_DWLoop) {
9435 if (abort) refs.length = save;
9438 if (node instanceof AST_For) {
9439 if (node.init) node.init.walk(tw);
9441 if (node.condition) node.condition.walk(tw);
9443 if (node.step) node.step.walk(tw);
9444 if (abort) refs.length = save;
9447 if (node instanceof AST_ForEnumeration) {
9452 if (abort) refs.length = save;
9455 if (node instanceof AST_Scope) {
9456 if (node === fn) return;
9459 if (node instanceof AST_SymbolRef) {
9460 if (node.definition() === def) refs.push(node);
9470 if (!(node instanceof AST_Binary)) return;
9485 if (node.truthy) return true;
9486 if (is_undefined(node)) return undefined;
9487 if (node.falsy && !nullish) return false;
9488 if (node.is_truthy()) return true;
9497 if (!is_statement(parent)) while (true) {
9500 if (parent instanceof AST_Binary) {
9503 if (lazy_op[parent.operator]) continue;
9506 if (match(parent.left)) switch (parent.operator) {
9517 } else if (parent instanceof AST_Conditional) {
9519 if (cond === child) continue;
9520 if (match(cond)) switch (child) {
9528 } else if (parent instanceof AST_Exit) {
9530 } else if (parent instanceof AST_If) {
9532 } else if (parent instanceof AST_Sequence) {
9533 if (parent.expressions[0] === child) continue;
9534 } else if (parent instanceof AST_SimpleStatement) {
9542 if (parent instanceof AST_BlockStatement) {
9543 if (parent.body[0] === child) continue;
9544 } else if (parent instanceof AST_If) {
9545 if (match(parent.condition)) switch (child) {
9558 if (node.equals(cond)) return true;
9559 if (!(cond instanceof AST_UnaryPrefix)) return false;
9560 if (cond.operator != "!") return false;
9561 if (!node.equals(cond.expression)) return false;
9568 if (is_empty(self.alternative)) self.alternative = null;
9570 if (!compressor.option("conditionals")) return self;
9571 if (compressor.option("booleans") && !self.condition.has_side_effects(compressor)) {
9574 // if condition can be statically determined, warn and drop
9578 if (compressor.option("dead_code")) {
9580 if (!cond) {
9586 if (self.alternative) body.push(self.alternative);
9588 } else if (!(cond instanceof AST_Node)) {
9594 …if (self.alternative) extract_declarations_from_unreachable_code(compressor, self.alternative, bod…
9602 if (self.alternative && negated_is_best) {
9619 if (body_exprs instanceof AST_BlockStatement || alt_exprs instanceof AST_BlockStatement) {
9621 if (body_exprs) {
9624 if (body_exprs instanceof AST_BlockStatement) {
9626 } else if (body_exprs.length == 0) {
9635 if (alt_exprs) {
9638 if (alt_exprs instanceof AST_BlockStatement) {
9640 } else if (alt_exprs.length == 0) {
9649 if (var_defs.length > 0) body.push(make_node(AST_Var, self, { definitions: var_defs }));
9650 if (body.length > 0) {
9654 } else if (body_exprs && alt_exprs) {
9656 … if (body_var_defs.length > 0 || alt_var_defs.length > 0) body.push(make_node(AST_Var, self, {
9659 if (body_exprs.length == 0) {
9667 } else if (alt_exprs.length == 0) {
9668 if (self_condition_length === negated_length && !negated_is_best
9695 if (is_empty(self.body)) self = make_node(AST_If, self, {
9700 if (self.alternative instanceof AST_Exit && self.body.TYPE == self.alternative.TYPE) {
9703 if (!cons_value && !alt_value) return make_node(AST_BlockStatement, self, {
9709 if (cons_value && alt_value || !keep_return_void()) {
9717 … if (exit instanceof AST_Return) exit.in_bool = self.body.in_bool || self.alternative.in_bool;
9721 if (self.body instanceof AST_If && !self.body.alternative && !self.alternative) {
9732 if (aborts(self.body) && self.alternative) {
9737 if (aborts(self.alternative)) {
9744 if (self.alternative) {
9752 if (stat.equals(alt_stat)) {
9757 if (!(stat instanceof AST_SimpleStatement)) break;
9758 if (!(alt_stat instanceof AST_SimpleStatement)) break;
9761 if (!expr1.equals(expr2)) break;
9767 if (stats.length > 0) {
9778 …if (compressor.option("typeofs")) mark_locally_defined(self.condition, self.body, self.alternative…
9788 if (node instanceof AST_Catch) {
9789 if (compressor.parent(level).bfinally) has_finally = true;
9791 } else if (node instanceof AST_Finally) {
9793 } else if (node instanceof AST_Scope) {
9795 } else if (node instanceof AST_Try) {
9796 if (node.bfinally) has_finally = true;
9803 if (!is_declaration(stats[index], true)) break;
9809 if (body instanceof AST_Sequence) {
9820 if (stat == null) return [];
9821 if (stat instanceof AST_BlockStatement) {
9825 if (line instanceof AST_EmptyStatement) continue;
9826 if (line instanceof AST_Exit) {
9827 if (i == 0) return;
9828 if (exprs.length > 0) {
9838 if (line instanceof AST_LambdaDefinition) {
9840 } else if (line instanceof AST_SimpleStatement) {
9841 if (!compressor.option("sequences") && exprs.length > 0) return;
9843 } else if (line instanceof AST_Var) {
9844 if (!compressor.option("sequences") && exprs.length > 0) return;
9853 if (stat instanceof AST_LambdaDefinition) {
9857 if (stat instanceof AST_EmptyStatement) return [];
9858 if (stat instanceof AST_SimpleStatement) return [ stat.body ];
9859 if (stat instanceof AST_Var) {
9867 if (!var_def.value) return;
9880 if (!compressor.option("switches")) return self;
9881 if (!compressor.option("dead_code")) return self;
9890 if (branch instanceof AST_Default) {
9892 … if (default_branch || is_break(branch.body[0], compressor) && (!prev || aborts(prev))) {
9905 if (!equals) {
9906 if (exp.has_side_effects(compressor)) side_effects.push(exp);
9910 if (!(equals instanceof AST_Node)) {
9911 if (default_branch) {
9917 if (exp.has_side_effects(compressor)) {
9925 if (i + 1 >= len || aborts(branch)) {
9928 if (aborts(prev)) switch (prev.body.length - statements.length) {
9931 if (!is_break(stat, compressor)) break;
9936 if (prev_block.equals(next_block)) prev.body = [];
9939 if (side_effects.length) {
9940 if (branch instanceof AST_Default) {
9950 if (side_effects.length && !exact_match) {
9955 if (is_break(stat, compressor)) branch.body.pop();
9956 if (branch === default_branch) {
9957 if (!has_declarations_only(branch)) break;
9958 } else if (branch.expression.has_side_effects(compressor)) {
9960 } else if (default_branch) {
9961 if (!has_declarations_only(default_branch)) break;
9962 if (body[body.length - 2] !== default_branch) break;
9965 } else if (!has_declarations_only(branch)) break;
9967 if (body.pop() === default_branch) default_branch = null;
9969 if (!branch) {
9971 if (side_effects.length) decl.push(make_node(AST_SimpleStatement, self, {
9976 if (branch === default_branch) while (branch = body[body.length - 2]) {
9977 if (branch instanceof AST_Default) break;
9978 if (!has_declarations_only(branch)) break;
9980 if (exp.has_side_effects(compressor)) {
9982 if (prev && !aborts(prev)) break;
9990 if (compressor.option("conditionals")) switch (body.length) {
9992 if (!no_break(body[0])) break;
9995 … if (body[0] !== default_branch && body[0] !== exact_match) return make_node(AST_If, self, {
10004 if (exp) statements.unshift(make_node(AST_SimpleStatement, exp, { body: exp }));
10008 if (!member(default_branch, body) || !no_break(body[1])) break;
10011 if (exclusive) statements.pop();
10012 if (!all(statements, no_break)) break;
10027 …if (!exclusive && alternative) node = make_node(AST_BlockStatement, self, { body: [ node, alternat…
10039 if (found
10042 if (is_break(node, tw)) found = true;
10050 if (prev && !aborts(prev)) {
10060 if (compressor.option("dead_code")) {
10061 if (has_declarations_only(self)
10066 if (self.bcatch) {
10069 if (!(stat instanceof AST_Var)) return;
10072 if (!def) return;
10079 if (self.bfinally) {
10084 if (self.bfinally && has_declarations_only(self.bfinally)) {
10087 … if (!self.bcatch) return make_node(AST_BlockStatement, self, { body: body }).optimize(compressor);
10099 if (defn.value) dropped = true;
10101 … if (node instanceof AST_SymbolDeclaration) defns.push(make_node(AST_VarDef, node, {
10121 if (value) {
10122 if (value instanceof AST_Sequence) value = value.clone();
10138 if (!ref.fixed) return;
10140 if (!assigns) return;
10141 if (assigns[0] !== defn) return;
10142 if (assigns.length > 1 || ref.fixed.to_binary || ref.fixed.to_prefix) {
10146 if (def.fixed === ref.fixed) def.fixed = fixed;
10156 if (assignments.length == 0) return null;
10165 if (compressor.exposed(def)) return true;
10169 if (s.var_names().has(def.name)) return true;
10180 if (def.scope === scope) return;
10203 if (node instanceof AST_SymbolDeclaration) return !can_varify(compressor, node);
10212 if (!compressor.option("optional_chains")) return;
10213 if (node.terminal) do {
10215 if (node.optional) {
10217 if (ev == null) return make_node(AST_UnaryPrefix, node, {
10221 if (!(ev instanceof AST_Node)) node.optional = false;
10229 if (!(exp instanceof AST_Sequence)) return node;
10240 if (!(fn instanceof AST_Lambda)) return;
10241 if (fn.uses_arguments) return;
10242 if (fn.pinned()) return;
10243 if (fns_with_marked_args && fns_with_marked_args.indexOf(fn) < 0) return;
10245 if (!all(args, function(arg) {
10250 if (fn.rest) {
10251 if (!(is_iife && compressor.option("rests"))) return;
10265 if (!argname) return true;
10266 if (argname instanceof AST_DestructuredArray) {
10269 if (argname instanceof AST_DestructuredObject) {
10277 … if (drop_defaults && argname instanceof AST_DefaultValue && args[i].is_defined(compressor)) {
10280 if (!argname || argname.unused !== undefined) {
10282 if (drop_fargs(argname)) {
10283 if (argname) argnames.splice(i, 1);
10285 if (node) side_effects.push(node);
10288 } else if (node) {
10292 } else if (argname) {
10293 if (side_effects.length) {
10301 } else if (drop_fargs(argname, args[i])) {
10305 if (node) side_effects.push(node);
10316 if (drop_fargs(argnames[i])) argnames.splice(i--, 1);
10321 if (!side_effects.length) return;
10330 if (!parent_scope) parent_scope = compressor.find_parent(AST_Scope);
10332 …if (is_async(parent_scope) || parent_scope instanceof AST_Toplevel && compressor.option("module"))…
10335 if (is_generator(parent_scope)) avoid.push("yield");
10340 if (!avoid) return true;
10343 if (!safe) return true;
10344 if (node instanceof AST_Scope) {
10345 if (node === fn) return;
10346 if (is_arrow(node)) {
10348 } else if (node instanceof AST_LambdaDefinition && avoid[node.name.name]) {
10353 if (node instanceof AST_Symbol && avoid[node.name] && node !== fn.name) safe = false;
10366 if (terminated) return terminated;
10367 if (compressor.option("sequences")) {
10368 if (exp instanceof AST_PropAccess) {
10370 if (seq !== exp) {
10376 } else if (!needs_unbinding(exp.tail_node())) {
10378 if (seq !== self) return seq.optimize(compressor);
10381 if (compressor.option("unused")) drop_unused_call_args(self, compressor);
10382 if (compressor.option("unsafe")) {
10383 if (is_undeclared_ref(exp)) switch (exp.name) {
10386 if (self.args.length == 1) {
10388 if (first instanceof AST_Number) try {
10390 if (length > 6) break;
10401 if (!first.is_boolean(compressor) && !first.is_string(compressor)) break;
10407 if (self.args.length == 0) return make_node(AST_Object, self, { properties: [] });
10411 if (self.args.length == 0) return make_node(AST_String, self, { value: "" });
10413 if (self.args.length == 1) return make_node(AST_Binary, self, {
10421 if (self.args.length == 0) return make_node(AST_Number, self, { value: 0 });
10423 if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
10434 if (self.args.length == 0) return make_node(AST_False, self).optimize(compressor);
10436 if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
10447 if (all(self.args, function(arg) {
10459 } else if (exp instanceof AST_Dot) switch (exp.property) {
10463 …if (self.args.length == 0 && !(expr.may_throw_on_access(compressor) || expr instanceof AST_Super))…
10472 if (exp.expression instanceof AST_Array && self.args.length < 2) EXIT: {
10476 if (exp.expression.elements.length == 0 && !(separator instanceof AST_Spread)) {
10482 if (separator) {
10484 if (separator instanceof AST_Node) break EXIT; // not a constant
10491 if (value !== el) {
10493 } else if (el instanceof AST_Spread) {
10496 if (consts.length > 0) {
10503 if (consts.length > 0) elements.push(make_node(AST_String, self, {
10510 if (elements.length == 1) {
10511 if (elements[0].is_string(compressor)) return elements[0];
10519 if (separator == "") {
10521 … if (elements[0].is_string(compressor) || elements[1].is_string(compressor)) {
10546 if (self.args.length < 2) {
10564 if (self.args.length == 2 && self.args[1] instanceof AST_Array) {
10578 if (func instanceof AST_SymbolRef) {
10581 if (func instanceof AST_Lambda && !func.contains_this()) {
10594 } else if (compressor.option("side_effects")
10604 if (compressor.option("unsafe_Function")
10608 if (self.args.length == 0) return make_node(AST_Function, self, {
10612 if (all(self.args, function(x) {
10617 // if the code argument is a constant, then we can minify it.
10632 if (fun) return true;
10633 if (node instanceof AST_Lambda) {
10652 if (ex instanceof JS_Parse_Error) {
10672 if (has_default == 1 && self.args[index] instanceof AST_Spread) has_default = 2;
10673 if (argname instanceof AST_DefaultValue) {
10674 if (!has_default) has_default = 1;
10676 if (!is_undefined(arg)) has_default = 2;
10677 if (has_arg_refs(fn, argname.value)) return false;
10680 if (argname instanceof AST_Destructured) {
10682 if (has_arg_refs(fn, argname)) return false;
10690 if (can_inline && stat instanceof AST_Return) {
10692 if (exp === fn
10699 if (is_func && !fn.contains_this()) {
10701 if (can_inline
10709 if (can_substitute_directly()) {
10713 if (node instanceof AST_SymbolRef) {
10715 if (fn.variables.get(node.name) !== def) {
10721 if (!arg) return make_node(AST_Undefined, self);
10728 if (exp !== fn) fn.inlined = true;
10731 if (!arg) return;
10734 if (node instanceof AST_SymbolRef) refs.push(node);
10742 if (replacing || best_of_expression(node, self) === node) {
10747 if (replacing) def.replaced++;
10751 } else if (!node.has_side_effects(compressor)) {
10761 if (replacing && can_inject_symbols()) {
10763 if (exp !== fn) fn.parent_scope = exp.scope;
10768 if (compressor.option("side_effects")
10777 if (compressor.option("drop_console")) {
10778 if (exp instanceof AST_PropAccess) {
10783 if (is_undeclared_ref(name) && name.name == "console") {
10788 …if (compressor.option("negate_iife") && parent instanceof AST_SimpleStatement && is_iife_call(curr…
10803 … if (destructured || has_spread) args = [ make_node(AST_Array, self, { elements: args }) ];
10804 if (destructured) {
10806 if (node instanceof AST_DefaultValue) return make_node(AST_DefaultValue, node, {
10810 if (node instanceof AST_DestructuredArray) {
10814 if (node) elements[index] = node;
10819 if (node instanceof AST_DestructuredObject) {
10824 if (value) {
10825 if (side_effects.length) {
10826 … if (!(key instanceof AST_Node)) key = make_node_from_constant(key, prop);
10835 } else if (key instanceof AST_Node) {
10839 … if (side_effects.length) properties.push(make_node(AST_DestructuredKeyVal, node, {
10845 if (node instanceof AST_SymbolFunarg) return null;
10850 if (argname) lhs[index] = argname;
10853 if (rest) lhs.length = fn.argnames.length;
10864 if (argname instanceof AST_DefaultValue) args.push(argname.value);
10875 if (!stat) return noop_value();
10876 if (stat instanceof AST_Return) return stat.value || noop_value();
10877 if (stat instanceof AST_SimpleStatement) {
10887 if (len < 2) {
10889 if (stat) return stat;
10891 if (compressor.option("inline") < 3) return false;
10895 if (line instanceof AST_Var) {
10896 if (var_assigned) {
10897 if (!stat) continue;
10898 if (!(stat instanceof AST_SimpleStatement)) return false;
10899 if (!declarations_only(line)) stat = null;
10900 } else if (!declarations_only(line)) {
10901 if (stat && !(stat instanceof AST_SimpleStatement)) return false;
10905 } else if (line instanceof AST_AsyncDefun
10909 } else if (stat) {
10920 if (fn.argnames[i].definition() === def) return i;
10925 if (has_default || has_destructured || has_spread || var_assigned || fn.rest) return;
10926 if (compressor.option("inline") < 2 && fn.argnames.length) return;
10927 if (!fn.variables.all(function(def) {
10937 if (abort) return true;
10938 if (node instanceof AST_Binary && lazy_op[node.operator]
10943 if (node instanceof AST_Scope) return abort = true;
10944 if (avoid && node instanceof AST_Symbol && avoid[node.name]) return abort = true;
10945 if (node instanceof AST_SymbolRef) {
10947 if (fn.variables.get(node.name) !== def) {
10951 if (def.init instanceof AST_LambdaDefinition) return abort = true;
10952 if (is_lhs(node, tw.parent())) return abort = true;
10954 if (!(begin < index)) begin = index;
10955 if (!in_order) return;
10956 if (side_effects) {
10963 if (side_effects) return;
10964 if (node instanceof AST_Assign && node.left instanceof AST_PropAccess) {
10966 if (node.left instanceof AST_Sub) node.left.property.walk(tw);
10971 if (node.has_side_effects(compressor)) {
10978 if (abort) return;
10980 if (in_order && fn.argnames.length >= end) {
10999 if (abort) return;
11000 if (arg.unused) return;
11001 if (!safe_to_inject || var_exists(defined, arg.name)) return abort = true;
11003 if (in_loop) in_loop.push(arg.definition());
11011 if (stat instanceof AST_LambdaDefinition) {
11013 if (!safe_to_inject) return false;
11014 if (arg_used.has(name.name)) return false;
11015 if (var_exists(defined, name.name)) return false;
11016 if (!all(stat.enclosed, function(def) {
11019 if (in_loop) in_loop.push(name.definition());
11022 if (!(stat instanceof AST_Var)) continue;
11023 if (!safe_to_inject) return false;
11026 if (var_exists(defined, name.name)) return false;
11027 if (in_loop) in_loop.push(name.definition());
11038 if (scope.variables) scope.variables.each(function(def) {
11043 if (scope instanceof AST_ClassField) {
11044 if (!scope.static) return false;
11045 } else if (scope instanceof AST_DWLoop) {
11047 } else if (scope instanceof AST_For) {
11048 if (scope.init === child) continue;
11050 } else if (scope instanceof AST_ForEnumeration) {
11051 if (scope.init === child) continue;
11052 if (scope.object === child) continue;
11057 if (!insert) return false;
11058 if (!safe_from_await_yield(fn, avoid_await_yield(compressor, scope))) return false;
11060 if (scope instanceof AST_Toplevel) {
11061 if (compressor.toplevel.vars) {
11069 if (!can_inject_args(defined, inline >= 2 && safe_to_inject)) return false;
11070 if (!can_inject_vars(defined, inline >= 3 && safe_to_inject)) return false;
11076 if (!scope.var_names().has(name.name)) {
11085 if (!value) return;
11105 if (argname instanceof AST_DefaultValue) {
11112 if (name.unused || scope.var_names().has(name.name)) {
11113 if (value) expressions.push(value);
11119 if (name.unused !== undefined) {
11121 if (value) expressions.push(value);
11123 if (!value && argname === name && (in_loop
11135 if (node.name.unused !== undefined) {
11154 if (argname.unused) return make_node(AST_Hole, argname);
11163 if (name.unused) return make_void_lhs(name);
11178 if (!(stat instanceof AST_LambdaDefinition)) return true;
11187 if (!(stat instanceof AST_LambdaDefinition)) return true;
11196 if (!(stat instanceof AST_Var)) {
11197 if (stat instanceof AST_SimpleStatement) exprs.push(stat.body);
11204 if (value && exprs.length > 0) {
11210 if (!in_loop) continue;
11211 if (arg_used.has(name.name)) continue;
11212 if (name.definition().orig.length == 1 && fn.functions.has(name.name)) continue;
11226 if (has_default > 1 || has_destructured || has_spread || fn.rest) {
11233 if (decls.length) args.push(make_node(AST_Var, fn, { definitions: decls }));
11236 if (scope.var_names().has(def.name)) return;
11245 if (compressor.option("unsafe")) {
11247 if (is_undeclared_ref(exp)) switch (exp.name) {
11256 if (compressor.option("sequences")) {
11258 if (seq !== self) return seq.optimize(compressor);
11260 if (compressor.option("unused")) drop_unused_call_args(self, compressor);
11267 if (!(node instanceof AST_Binary)) return;
11268 if (!(node.operator == "&&" || node.operator == "||")) return;
11269 if (!(node.right instanceof AST_Assign)) return;
11270 if (node.right.operator != "=") return;
11271 if (!(node.right.left instanceof AST_SymbolRef)) return;
11272 if (node.right.left.definition() !== def) return;
11273 if (value.has_side_effects(compressor)) return;
11274 if (!safe_from_assignment(node.left)) return;
11275 if (!safe_from_assignment(node.right.right)) return;
11288 if (node.has_side_effects(compressor)) return;
11291 if (hit) return true;
11292 if (node instanceof AST_SymbolRef && node.definition() === def) return hit = true;
11303 if (end == 0) {
11305 if (!(self instanceof AST_Sequence)) self = self.optimize(compressor);
11312 if (!compressor.option("side_effects")) return self.expressions;
11317 if (index < last) expr = expr.drop_side_effect_free(compressor, first);
11318 if (expr) {
11327 if (!compressor.option("side_effects")) return;
11329 if (end < expressions.length - 1) {
11349 if (!def) continue;
11351 if (compressor.option("conditionals")) {
11353 if (cond) {
11360 if (compressor.option("dead_code")
11370 if (compressor.option("sequences")) {
11372 if (seq !== self) return seq.optimize(compressor);
11382 if (compressor.option("sequences") && can_lift()) {
11384 if (seq !== self) return seq.optimize(compressor);
11388 if (!compressor.option("evaluate")) break;
11389 if (!exp.is_number(compressor, true)) break;
11391 if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") break;
11394 if (exp instanceof AST_Infinity) exp = exp.transform(compressor);
11396 if (exp instanceof AST_Number || exp instanceof AST_Infinity) return self;
11399 if (!compressor.option("booleans")) break;
11400 …if (exp.is_truthy()) return make_sequence(self, [ exp, make_node(AST_False, self) ]).optimize(comp…
11401 if (compressor.in_boolean_context()) {
11402 // !!foo ---> foo, if we're in boolean context
11403 if (exp instanceof AST_UnaryPrefix && exp.operator == "!") return exp.expression;
11404 if (exp instanceof AST_Binary) {
11411 if (!compressor.option("evaluate")) break;
11412 if (may_not_delete(exp)) break;
11415 if (!compressor.option("booleans")) break;
11416 if (!compressor.in_boolean_context()) break;
11420 … if (!(exp instanceof AST_SymbolRef && can_drop_symbol(exp, compressor))) exprs.unshift(exp);
11423 if (!compressor.option("side_effects")) break;
11425 if (!exp) return make_node(AST_Undefined, self).optimize(compressor);
11429 if (compressor.option("evaluate")
11467 if (!compressor.option("awaits")) return self;
11468 if (compressor.option("sequences")) {
11470 if (seq !== self) return seq.optimize(compressor);
11472 if (compressor.option("side_effects")) {
11474 if (exp instanceof AST_Await) return exp.optimize(compressor);
11475 …if (exp instanceof AST_UnaryPrefix && exp.expression instanceof AST_Await) return exp.optimize(com…
11477 if (is_arrow(parent)) {
11478 if (parent.value === node) return exp.optimize(compressor);
11479 } else if (parent instanceof AST_Return) {
11484 … if (parent instanceof AST_Try && (parent.bfinally || parent.bcatch) !== node) {
11489 if (drop) return exp.optimize(compressor);
11490 } else if (parent instanceof AST_Sequence) {
11491 if (parent.tail_node() === node) continue;
11500 if (!compressor.option("yields")) return self;
11501 if (compressor.option("sequences")) {
11503 if (seq !== self) return seq.optimize(compressor);
11506 if (self.nested && exp.TYPE == "Call") {
11508 if (inlined.TYPE != "Call") return inlined;
11514 if (this.left instanceof AST_PropAccess) {
11515 if (!(this.left.expression instanceof AST_Sequence)) return this;
11523 if (this.left instanceof AST_Sequence) {
11530 if (this.right instanceof AST_Sequence) {
11531 if (this.left.has_side_effects(compressor)) return this;
11536 if (!assign && x[i].has_side_effects(compressor)) break;
11538 if (i == last) {
11545 if (i > 0) {
11559 … if (node instanceof AST_Assign) return !plain && node.operator == "=" && is_object(node.right);
11560 if (node instanceof AST_New) return !plain;
11561 if (node instanceof AST_Sequence) return is_object(node.tail_node(), plain);
11562 if (node instanceof AST_SymbolRef) return !plain && is_object(node.fixed_value());
11574 if (rhs instanceof AST_SymbolRef) rhs = rhs.fixed_value();
11582 if (node.is_constant()) return true;
11583 …if (node instanceof AST_Assign) return node.operator != "=" || needs_enqueuing(compressor, node.ri…
11584 if (node instanceof AST_Binary) {
11588 if (node instanceof AST_Call) return is_async(node.expression);
11589 if (node instanceof AST_Conditional) {
11592 if (node instanceof AST_Sequence) return needs_enqueuing(compressor, node.tail_node());
11593 if (node instanceof AST_SymbolRef) {
11597 if (node instanceof AST_Template) return !node.tag || is_raw_tag(compressor, node.tag);
11598 if (node instanceof AST_Unary) return true;
11602 … if (node instanceof AST_Assign) return is_lhs_read_only(node.left, compressor) ? node : node.left;
11603 if (node instanceof AST_Sequence) return extract_lhs(node.tail_node(), compressor);
11604 if (node instanceof AST_UnaryPrefix && UNARY_POSTFIX[node.operator]) {
11611 if (node instanceof AST_Dot) return repeatable(compressor, node.expression);
11612 if (node instanceof AST_Sub) {
11615 if (node instanceof AST_Symbol) return true;
11621 if (rhs !== self.right) {
11636 if (compressor) {
11638 } else if (self.operator == rhs.left.operator) {
11644 if (commutativeOperators[self.operator]
11649 // if right is a constant, whatever side effects the
11654 if (compressor.option("sequences")) {
11656 if (seq !== self) return seq.optimize(compressor);
11658 if (compressor.option("assignments") && lazy_op[self.operator]) {
11663 if (lhs instanceof AST_SymbolRef
11677 if (lhs.fixed) {
11689 if (compressor.option("comparisons")) switch (self.operator) {
11692 if (is_undefined(self.left, compressor) && self.right.is_defined(compressor)) {
11700 if ((self.left.is_string(compressor) && self.right.is_string(compressor)) ||
11710 if (!is_strict_comparison && is_undefined(self.left, compressor)) {
11714 else if (compressor.option("typeofs")
11720 if (expr instanceof AST_SymbolRef ? expr.is_declared(compressor)
11724 if (self.operator.length == 2) self.operator += "=";
11728 else if (self.left instanceof AST_SymbolRef
11740 if (!(left instanceof AST_Binary)) break;
11741 if (left.operator != (self.operator == "&&" ? "!==" : "===")) break;
11742 if (!(self.right instanceof AST_Binary)) break;
11743 if (left.operator != self.right.operator) break;
11744 if (is_undefined(left.left, compressor) && self.right.left instanceof AST_Null
11747 if (expr instanceof AST_Assign && expr.operator == "=") expr = expr.left;
11748 if (expr.has_side_effects(compressor)) break;
11749 if (!expr.equals(self.right.right)) break;
11758 if (compressor.option("booleans")) {
11760 if (lazy_op[self.operator] && !lhs.has_side_effects(compressor)) {
11763 if (lhs.equals(self.right)) {
11770 if (in_bool) switch (self.operator) {
11773 …if (ev && typeof ev == "string" || (ev = self.right.evaluate(compressor, true)) && typeof ev == "s…
11776 if (self.left.evaluate(compressor) instanceof AST_Node) exprs.push(self.left);
11777 if (self.right.evaluate(compressor) instanceof AST_Node) exprs.push(self.right);
11778 if (exprs.length < 2) {
11786 …if (self.left instanceof AST_String && self.left.value == "" && self.right.is_string(compressor)) {
11794 …if (self.left instanceof AST_String && self.left.value == "" && self.right.is_string(compressor)) {
11799 if (compressor.option("comparisons") && self.is_boolean(compressor)) {
11800 if (parent.TYPE != "Binary") {
11805 if (best_of(compressor, self, negated) === negated) return negated;
11812 if (compressor.option("conditionals") && lazy_op[self.operator]) {
11813 if (self.left instanceof AST_Binary && self.operator == self.left.operator) {
11820 if (before !== after) {
11828 … if (rhs instanceof AST_Binary && self.operator == rhs.operator) swap_chain(self, compressor);
11830 if (compressor.option("strings") && self.operator == "+") {
11832 if (self.right instanceof AST_String
11838 if (self.left instanceof AST_String
11844 if (self.left instanceof AST_Binary
11856 if (rhs instanceof AST_Binary
11864 if (compressor.option("evaluate")) {
11869 if (!ll) {
11872 } else if (!(ll instanceof AST_Node)) {
11876 if (!self.right.evaluate(compressor, true)) {
11877 if (in_bool && !(self.right.evaluate(compressor) instanceof AST_Node)) {
11881 } else if ((in_bool || parent.operator == "&&" && parent.left === compressor.self())
11887 if (self.left.operator == "||") {
11889 if (!lr) return make_node(AST_Conditional, self, {
11900 if (nullish ? ll == null : !ll) {
11907 } else if (!(ll instanceof AST_Node)) {
11916 … if (!nullish && (rr = self.right.evaluate(compressor, true)) && !(rr instanceof AST_Node)) {
11917 if (in_bool && !(self.right.evaluate(compressor) instanceof AST_Node)) {
11921 } else if ((in_bool || parent.operator == "||" && parent.left === compressor.self())
11927 if (!nullish && self.left.operator == "&&") {
11929 if (lr && !(lr instanceof AST_Node)) return make_node(AST_Conditional, self, {
11938 if (self.left instanceof AST_Constant
11954 if (self.right instanceof AST_Constant
11970 if (self.right instanceof AST_UnaryPrefix
11981 if (self.left instanceof AST_UnaryPrefix
11993 if (compressor.option("unsafe_math")
12014 if (self.right instanceof AST_UnaryPrefix
12030 if (self.operator != "+") [ "left", "right" ].forEach(function(operand) {
12032 if (node instanceof AST_UnaryPrefix && node.operator == "+") {
12034 … if (exp.is_boolean(compressor) || exp.is_number(compressor) || exp.is_string(compressor)) {
12043 if (self.operator != "-"
12057 if (!associative || !self.is_number(compressor)) break;
12059 if (self.right instanceof AST_Binary
12081 if (self.operator == "+"
12092 if (self.right instanceof AST_Constant
12097 if (self.left.left instanceof AST_Constant) {
12103 } else if (self.left.right instanceof AST_Constant) {
12106 if (rhs.is_constant()
12117 if (is_lambda(self.right)) return make_sequence(self, [
12123 if (!(parent instanceof AST_UnaryPrefix && parent.operator == "delete")) {
12124 … if (self.left instanceof AST_Number && !self.right.is_constant()) switch (self.operator) {
12127 if (self.left.value == 0) {
12128 … if (self.right.is_boolean(compressor)) return make_node(AST_UnaryPrefix, self, {
12132 … if (self.right.is_number(compressor) && !self.right.is_negative_zero()) return self.right;
12137 if (self.left.value == 1) return make_node(AST_UnaryPrefix, self, {
12143 … if (self.right instanceof AST_Number && !self.left.is_constant()) switch (self.operator) {
12146 if (self.right.value == 0) {
12147 … if (self.left.is_boolean(compressor)) return make_node(AST_UnaryPrefix, self, {
12151 … if (self.left.is_number(compressor) && !self.left.is_negative_zero()) return self.left;
12156 if (self.right.value == 0) return make_node(AST_UnaryPrefix, self, {
12163 if (self.right.value == 1) return make_node(AST_UnaryPrefix, self, {
12171 if (compressor.option("typeofs")) switch (self.operator) {
12179 if (compressor.option("unsafe")) {
12181 if (in_bool
12192 if (compressor.option("comparisons") && is_indexOf_match_pattern()) {
12202 if (indexLeft) break;
12219 if (found) return true;
12220 if (node instanceof AST_Assign) {
12221 if (node.left instanceof AST_PropAccess) return found = true;
12222 } else if (node instanceof AST_Unary) {
12223 … if (unary_side_effects[node.operator] && node.expression instanceof AST_PropAccess) {
12243 if (op == "+") {
12244 if (!left.is_boolean(compressor) && !left.is_number(compressor)) {
12250 if (!right.is_boolean(compressor) && !right.is_number(compressor)) {
12277 … if (indexLeft && self.right instanceof AST_Number && self.right.value == 0) return true;
12283 if (!indexRight) return false;
12298 if (reversible()) {
12299 if (op) self.operator = op;
12314 if (node === fn) return node;
12315 if (is_lambda(node) && node.name && node.name.definition() === def) return node;
12327 if (!compressor.option("ie")
12341 … if (compressor.option("reduce_vars") && is_lhs(compressor.self(), parent) !== compressor.self()) {
12345 if (single_use) {
12346 if (is_lambda(fixed)) {
12347 if ((def.scope !== self.scope.resolve(true) || def.in_loop)
12350 } else if (def.redefined()) {
12352 } else if (recursive_ref(compressor, def, fixed)) {
12354 } else if (fixed.name && fixed.name.definition() !== def) {
12356 } else if (fixed.parent_scope !== self.scope || is_funarg(def)) {
12357 if (!safe_from_strict_mode(fixed, compressor)) {
12359 } else if ((single_use = fixed.is_constant_expression(self.scope)) == "f") {
12362 … if (scope instanceof AST_LambdaDefinition || scope instanceof AST_LambdaExpression) {
12367 } else if (fixed.name && (fixed.name.name == "await" && is_async(fixed)
12370 } else if (fixed.has_side_effects(compressor)) {
12372 } else if (compressor.option("ie") && fixed instanceof AST_Class) {
12375 if (single_use) fixed.parent_scope = self.scope;
12376 } else if (!fixed
12383 if (single_use) {
12387 if (fixed instanceof AST_DefClass) fixed = to_class_expr(fixed);
12388 if (fixed instanceof AST_LambdaDefinition) fixed = to_func_expr(fixed);
12389 if (is_lambda(fixed)) {
12394 if (scope === def.scope) break;
12397 if (fixed.variables.has(def.name)) return;
12400 if (!push_uniq(scope.enclosed, def)) return;
12406 if (def.recursive_refs > 0) {
12412 if (value instanceof AST_Class) {
12419 if (!(name instanceof symbol_type)) {
12427 if (node instanceof AST_SymbolDeclaration) {
12428 if (node !== name) {
12435 if (!(node instanceof AST_SymbolRef)) return;
12437 if (def === defun_def) {
12442 if (is_lambda(fn)
12454 if (fixed instanceof AST_Scope) {
12462 if (node instanceof AST_Scope) return node;
12472 if (fixed && (state = self.fixed || def.fixed).should_replace !== false) {
12474 if (fixed instanceof AST_This) {
12475 if (!is_funarg(def) && same_scope(def) && !cross_class(def)) init = fixed;
12476 } else if ((ev = fixed.evaluate(compressor, true)) !== fixed
12484 if (init) {
12485 if (state.should_replace === undefined) {
12487 if (!has_symbol_ref(fixed)) {
12491 if (compressor.option("unused") && !compressor.exposed(def)) {
12500 if (state.should_replace) {
12502 if (has_symbol_ref(fixed)) {
12504 if (value === init) value = value.clone(true);
12507 if (value === init || value === fixed) value = value.clone(true);
12520 if (scope instanceof AST_Class) return true;
12528 if (node instanceof AST_SymbolRef) found = true;
12529 if (found) return true;
12547 if (typeof ch == "string") return ch;
12550 if (!malformed) return str;
12554 if (!compressor.option("templates")) return self;
12556 if (!tag || is_raw_tag(compressor, tag)) {
12561 if (!tag) {
12563 if (trimmed) str = escape_literal(trimmed);
12565 if (i > 0) {
12568 if (value) {
12572 if (tag || typeof (decoded = decode_template(joined)) == status) {
12580 if (!tag) status = typeof trimmed;
12582 if (!tag && strs.length > 1) {
12583 if (strs[strs.length - 1] == "") return make_node(AST_Binary, self, {
12591 if (strs[0] == "") {
12627 if (ev === node) return;
12628 if (tag && /\r|\\|`/.test(ev)) return;
12630 if (ev.length > node.print_to_string().length + "${}".length) return;
12640 if (compressor.option("unsafe_undefined")) {
12642 if (undef) {
12653 if (lhs && is_atomic(lhs, self)) return self;
12662 if (lhs && is_atomic(lhs, self)) return self;
12663 …if (compressor.option("keep_infinity") && !lhs && !find_scope(compressor).find_variable("Infinity"…
12675 if (lhs && is_atomic(lhs, self)) return self;
12676 if (!lhs && !find_scope(compressor).find_variable("NaN")) return self;
12687 if (reachable) return true;
12688 … if (node instanceof AST_SymbolRef && member(node.definition(), defs)) return reachable = true;
12691 if (reachable) return true;
12692 if (node instanceof AST_Lambda && node !== self) {
12693 if (!(node.name || is_async(node) || is_generator(node))) {
12695 if (parent instanceof AST_Call && parent.expression === node) return;
12708 if (compressor.option("dead_code")) {
12709 if (self.left instanceof AST_PropAccess) {
12710 if (self.operator == "=") {
12711 if (self.redundant) {
12713 if (self.left instanceof AST_Sub) exprs.push(self.left.property);
12717 if (self.left.equals(self.right) && !self.left.has_side_effects(compressor)) {
12721 if (exp instanceof AST_Lambda
12731 … } else if (self.left instanceof AST_SymbolRef && can_drop_symbol(self.left, compressor)) {
12733 if (self.operator == "=" && self.left.equals(self.right)
12737 if (self.left.is_immutable()) return strip_assignment();
12743 … if (!(scope.uses_arguments && is_funarg(def)) || compressor.has_directive("use strict")) do {
12746 if (parent instanceof AST_Assign) {
12747 … if (parent.left instanceof AST_SymbolRef && parent.left.definition() === def) {
12748 if (in_try(level, parent, !local)) break;
12751 if (parent.left.match_symbol(function(node) {
12752 if (node instanceof AST_PropAccess) return true;
12756 if (parent instanceof AST_Exit) {
12757 if (!local) break;
12758 if (in_try(level, parent)) break;
12759 if (is_reachable(scope, [ def ])) break;
12762 if (parent instanceof AST_SimpleStatement) {
12763 if (!local) break;
12764 if (is_reachable(scope, [ def ])) break;
12769 … if (parent === scope && is_last_statement(parent.body, stat)) return strip_assignment(def);
12773 if (parent instanceof AST_VarDef) {
12774 if (!(parent.name instanceof AST_SymbolDeclaration)) continue;
12775 if (parent.name.definition() !== def) continue;
12776 if (in_try(level, parent)) break;
12782 if (compressor.option("sequences")) {
12784 if (seq !== self) return seq.optimize(compressor);
12786 if (compressor.option("assignments")) {
12787 …if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary…
12789 if (self.right.left instanceof AST_SymbolRef
12795 if (self.right.right instanceof AST_SymbolRef
12803 if ((self.operator == "-=" || self.operator == "+="
12817 if (parent instanceof AST_Binary) switch (node) {
12825 if (parent instanceof AST_Conditional) switch (node) {
12835 if (parent instanceof AST_Sequence) {
12838 if (stop < 0) return false;
12840 if (!exprs[i].is_constant_expression(scope)) return false;
12848 if (parent instanceof AST_BlockStatement) return is_last_statement(parent.body, stat);
12849 if (parent instanceof AST_Catch) return is_last_statement(parent.body, stat);
12850 if (parent instanceof AST_Finally) return is_last_statement(parent.body, stat);
12851 … if (parent instanceof AST_If) return parent.body === stat || parent.alternative === stat;
12852 …if (parent instanceof AST_Try) return parent.bfinally ? parent.bfinally === stat : parent.bcatch =…
12865 if (fixed) fixed.to_binary = replace_ref(function(node) {
12876 if (def) def.fixed = false;
12886 if (compressor.option("sequences") && self.condition instanceof AST_Sequence) {
12893 if (!compressor.option("conditionals")) return self;
12895 if (compressor.option("booleans") && !condition.has_side_effects(compressor)) {
12899 if (!condition) {
12902 } else if (!(condition instanceof AST_Node)) {
12908 if ((first ? best_of_statement : best_of_expression)(condition, negated) === negated) {
12920 if (repeatable(compressor, cond_lhs)) {
12922 if (cond_lhs.equals(consequent)) return make_node(AST_Binary, self, {
12928 if (cond_lhs.equals(alternative)) return make_node(AST_Binary, self, {
12934 // if (foo) exp = something; else exp = something_else;
12939 if (seq_tail instanceof AST_Assign) {
12942 if ((is_eq || consequent === seq_tail)
12964 if (seq_tail.equals(alt_tail)) return make_sequence(self, consequent.equals(alternative) ? [
12979 if (combined) return combined;
12982 if (consequent instanceof AST_Call
13004 if (seq_tail instanceof AST_Conditional
13017 if (seq_tail instanceof AST_Conditional
13030 if (alt_tail instanceof AST_Conditional
13043 if (alt_tail instanceof AST_Conditional
13056 if (seq_tail instanceof AST_Binary
13070 if (seq_tail instanceof AST_Binary
13084 if (alt_tail instanceof AST_Binary
13098 if (alt_tail instanceof AST_Binary
13112 if (is_true(consequent)) {
13114 if (is_false(alternative)) return booleanize(condition);
13122 if (is_false(consequent)) {
13124 if (is_true(alternative)) return booleanize(condition.negate(compressor));
13133 if (is_true(alternative)) return make_node(AST_Binary, self, {
13139 if (is_false(alternative)) return make_node(AST_Binary, self, {
13144 if (compressor.option("typeofs")) mark_locally_defined(condition, consequent, alternative);
13148 if (node.is_boolean(compressor)) return node;
13186 if (len != b.length) return -2;
13188 if (!a[i].equals(b[i])) {
13189 if (a[i] instanceof AST_Spread !== b[i] instanceof AST_Spread) return -3;
13191 if (!a[j].equals(b[j])) return -2;
13200 if (node === tail) return tail[prop];
13207 if (consequent.TYPE != alternative.TYPE) return;
13208 if (consequent.optional != alternative.optional) return;
13209 if (consequent instanceof AST_Call) {
13210 if (arg_diff(consequent, alternative) != -1) return;
13216 if (!(consequent instanceof AST_PropAccess)) return;
13226 … if (!is_tail_equivalent(seq_tail, alt_tail)) return !top && make_node(AST_Conditional, self, {
13235 if (seq_tail.expression instanceof AST_Sequence) {
13249 if (!(node instanceof AST_Sequence)) return node.right;
13256 if (!(node instanceof AST_Sequence)) return make_node(AST_Number, node, { value: 0 });
13262 if (!compressor.option("booleans")) return self;
13263 … if (compressor.in_boolean_context()) return make_node(AST_Number, self, { value: +self.value });
13265 if (p instanceof AST_Binary && (p.operator == "==" || p.operator == "!=")) {
13281 …if (compressor.option("spreads") && exp instanceof AST_Array && !(compressor.parent() instanceof A…
13290 if (!value) return false;
13292 if (parent.TYPE != "Call") return true;
13293 if (parent.expression !== compressor.self()) return true;
13294 if (value instanceof AST_SymbolRef) {
13296 if (!value) return false;
13305 if (terminated) return terminated;
13306 if (compressor.option("properties")) {
13308 if (key !== prop) {
13309 if (typeof key == "string") {
13310 if (key == "undefined") {
13314 if (value.toString() == key) {
13321 if (is_identifier_string(property)
13335 if (compressor.option("arguments")
13343 if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
13344 if (!def.deleted) def.deleted = [];
13348 if (def.deleted && def.deleted[index]) {
13350 } else if (argname) {
13352 if (!(argname instanceof AST_SymbolFunarg)
13356 } else if (compressor.has_directive("use strict")
13367 … if (has_reassigned() || arg_def.assignments || arg_def.orig.length > 1) argname = null;
13369 } else if ((assigned || !has_reassigned())
13378 if (argname && find_if(function(node) {
13381 if (assigned) def.reassigned--;
13388 if (assigned) return self;
13389 if (compressor.option("sequences")
13393 if (seq !== self) return seq.optimize(compressor);
13395 if (key !== prop) {
13397 if (sub) {
13403 if (compressor.option("properties")
13412 if (safe_to_flatten(retValue, compressor)) {
13418 if (value) {
13420 if (flatten && value.has_side_effects(compressor)) flatten = false;
13423 if (!flatten) values.unshift(retValue);
13426 if (value) {
13428 } else if (is_hole) {
13434 if (flatten) {
13449 if (p instanceof AST_Lambda) {
13450 if (p instanceof AST_Accessor) return;
13451 if (is_arrow(p)) continue;
13467 if (result) return true;
13468 if (node instanceof AST_Super) return result = true;
13469 if (node !== self && node instanceof AST_Scope && !is_arrow(node)) return true;
13475 // returns false only if context bound by the specified scope (or scope
13485 if (result) return true;
13486 if (node instanceof AST_This) return result = true;
13487 if (node !== self && node instanceof AST_Scope && !is_arrow(node)) return true;
13502 if (!compressor.option("properties")) return;
13503 if (key === "__proto__") return;
13506 if (!(expr instanceof AST_Object)) return;
13510 if (prop.key !== key) continue;
13511 if (!all(props, can_hoist_property)) return;
13512 if (!safe_to_flatten(prop.value, compressor)) return;
13516 if (props[j] instanceof AST_ObjectMethod) {
13518 if (arrow) {
13519 if (!scope) scope = compressor.find_parent(AST_Scope);
13522 if (avoid[argname.name]) arrow = false;
13526 if (arrow) {
13528 } else if (i != j
13546 if (self.property == "arguments" || self.property == "caller") {
13550 if (is_lhs(compressor.self(), parent)) return self;
13552 if (terminated) return terminated;
13553 if (compressor.option("sequences")
13557 if (seq !== self) return seq.optimize(compressor);
13559 if (compressor.option("unsafe_proto")
13563 if (is_undeclared_ref(exp)) switch (exp.name) {
13588 if (sub) return sub.optimize(compressor);
13593 if (compressor.option("rests") && self.rest instanceof AST_DestructuredArray) {
13603 if (compressor.option("objects")) {
13605 if (key instanceof AST_Node) {
13607 if (key !== self.key) self.key = "" + key;
13614 if (!compressor.option("objects")) return self;
13623 if (!(prop instanceof AST_Spread)) return process(prop);
13626 …if (compressor.option("spreads") && exp instanceof AST_Object && all(exp.properties, function(prop…
13627 if (prop instanceof AST_ObjectGetter) return false;
13628 if (prop instanceof AST_Spread) return false;
13629 if (prop.key !== "__proto__") return true;
13630 if (prop instanceof AST_ObjectSetter) return true;
13637 if (key === "__proto__") {
13638 if (!setter) return;
13653 if (!changed) return self;
13654 if (found && generated && values.length == 1) {
13656 if (value instanceof AST_ObjectProperty && value.key instanceof AST_Number) {
13679 if (tail) values.push(tail);
13688 if (key instanceof AST_Node) {
13691 if (key === prop.key || key === "__proto__") {
13697 if (can_hoist_property(prop)) {
13698 if (prop.value.has_side_effects(compressor)) flush();
13705 if (found && !generated && typeof key == "string" && RE_POSITIVE_INTEGER.test(key)) {
13707 if (map.has(key)) prop = map.get(key)[0];
13715 if (redef) {
13725 if (found) return true;
13726 … if (node instanceof AST_SymbolRef && fn.variables.get(node.name) === node.definition()) {
13737 if (!fixed || !push_uniq(visited, fixed)) return;
13738 if (fixed.assigns) {
13754 if (def.fixed) {
13770 if (!compressor.option("awaits")) return;
13773 if (!inlined) return;
13774 if (!no_return) scan_local_returns(inlined, function(node) {
13777 if (value instanceof AST_Await) return;
13789 if (no_return === undefined) return;
13792 if (!lazy_op[op]) return;
13794 if (!inlined) return;
13819 if (no_return) return;
13820 if (!this.variables) return;
13823 if (last < 0) return;
13825 if (!inlined) return;
13830 if (compressor.option("inline") < 4) return;
13832 if (call.is_expr_pure(compressor)) return;
13834 if (!(fn instanceof AST_LambdaExpression)) return;
13835 if (fn.name) return;
13836 if (fn.uses_arguments) return;
13837 if (fn.pinned()) return;
13838 if (is_generator(fn)) return;
13840 if (arrow && fn.value) return;
13841 if (fn.body[0] instanceof AST_Directive) return;
13842 if (fn.contains_this()) return;
13843 if (!scope) scope = find_scope(compressor);
13852 if (!member(scope, compressor.stack)) return;
13853 if (scope.pinned() && fn.variables.size() > (arrow ? 0 : 1)) return;
13854 if (scope instanceof AST_Toplevel) {
13855 if (fn.variables.size() > (arrow ? 0 : 1)) {
13856 if (!compressor.toplevel.vars) return;
13857 if (fn.functions.size() > 0 && !compressor.toplevel.funcs) return;
13862 if (async) {
13863 if (!compressor.option("awaits")) return;
13864 if (!is_async(scope)) return;
13865 if (call.may_throw(compressor)) return;
13868 if (in_loop) in_loop = [];
13869 if (!fn.variables.all(function(def, name) {
13870 if (in_loop) in_loop.push(def);
13871 if (!defined.has(name) && !names.has(name)) return true;
13874 if (in_loop && in_loop.length > 0 && is_reachable(fn, in_loop)) return;
13876 if (!all(fn.argnames, function(argname) {
13879 if (abort) return true;
13880 if (node instanceof AST_DefaultValue) {
13881 if (has_arg_refs(fn, node.value)) return abort = true;
13885 if (node instanceof AST_DestructuredKeyVal) {
13886 … if (node.key instanceof AST_Node && has_arg_refs(fn, node.key)) return abort = true;
13890 … if (node instanceof AST_SymbolFunarg && !all(node.definition().orig, function(sym) {
13895 if (abort) return false;
13896 if (!(argname instanceof AST_SymbolFunarg)) simple_argnames = false;
13899 if (fn.rest) {
13900 if (has_arg_refs(fn, fn.rest)) return;
13904 if (no_return) {
13908 if (abort) return true;
13909 if (async && (node instanceof AST_Await || node instanceof AST_ForAwaitOf)
13913 if (node instanceof AST_Scope) return true;
13917 } else if (in_await || is_async(fn) || in_async_generator(scope)) {
13921 if (abort) return true;
13922 if (node instanceof AST_Return) return abort = true;
13923 if (node instanceof AST_Scope) return true;
13926 if (abort) return true;
13927 if (node instanceof AST_Try) {
13928 if (node.bfinally && all(node.body, function(stat) {
13934 if (node instanceof AST_Scope) return true;
13939 if (verify_body && !all(fn.body, verify_body)) return;
13940 if (!safe_from_await_yield(fn, avoid_await_yield(compressor, scope))) return;
13946 if (!arrow && name == "arguments" && def.orig.length == 1) return;
13951 if (!in_loop) return;
13952 if (def.references.length == def.replaced) return;
13953 if (def.orig.length == def.eliminated) return;
13954 if (def.orig.length == 1 && fn.functions.has(name)) return;
13955 if (!all(def.orig, function(sym) {
13956 if (sym instanceof AST_SymbolConst) return false;
13957 … if (sym instanceof AST_SymbolFunarg) return !sym.unused && def.scope.resolve() !== fn;
13958 if (sym instanceof AST_SymbolLet) return false;
13962 if (sym instanceof AST_SymbolCatch) return;
13966 if (simple_argnames && all(call.args, function(arg) {
13972 if (argname.unused) {
13973 if (value) body.push(make_node(AST_SimpleStatement, call, { body: value }));
13980 … if (argname instanceof AST_SymbolFunarg) insert_assign(argname.definition(), defn);
13983 if (values.length) body.push(make_node(AST_SimpleStatement, call, {
13991 if (argname.unused) return make_node(AST_Hole, argname);
14006 if (!(stat instanceof AST_LambdaDefinition)) return true;
14021 if (!no_return) {
14022 if (async) scan_local_returns(inlined, function(node) {
14024 if (is_undefined(value)) return;
14043 if (!body && !alt) return;
14051 if (no_return) return make_node(AST_SimpleStatement, value, { body: value });
14057 if (body) this.body = body;
14059 if (inlined) {
14061 if (inlined) {
14063 if (inlined instanceof AST_BlockStatement) {
14074 if (body) this.body = body;
14076 if (obj instanceof AST_Sequence) {
14078 if (inlined) {
14088 if (body) this.body = body;
14090 if (alt) {
14092 if (alt) this.alternative = alt;
14095 if (cond instanceof AST_Sequence) {
14097 if (inlined) {
14107 if (!body) return;
14113 if (!body) return;
14114 if (this.body instanceof AST_IterationStatement && body instanceof AST_BlockStatement) {
14132 if (!inlined) continue;
14136 if (body.length == 0) return;
14138 if (!no_return && body[0] instanceof AST_SimpleStatement) {
14144 if (j > i + 1) body.push(make_node(AST_SimpleStatement, node, {
14157 if (unary_side_effects[op]) break;
14158 if (op == "void") break;
14161 if (!no_return && !is_undefined(body)) body = make_node(AST_UnaryPrefix, this, {
14170 if (unary_side_effects[op]) return;
14171 if (!no_return && op == "void") no_return = false;
14173 if (!inlined) return;
14174 if (!no_return) scan_local_returns(inlined, function(node) {
14177 if (op == "void" && is_undefined(value)) return;
14187 if (body) this.body = body;
14189 if (exp instanceof AST_Sequence) {
14191 if (inlined) {
14200 if (!compressor.option("yields")) return;
14201 if (!this.nested) return;
14203 if (call.TYPE != "Call") return;
14225 if (value && compressor.option("side_effects")
14235 if (self._optimized) return self;
14236 if (compressor.has_directive("use asm")) return self;