(renderer, name, value2, main_execution_context = false)
| 15102 | return invalidate2; |
| 15103 | } |
| 15104 | function renderer_invalidate(renderer, name, value2, main_execution_context = false) { |
| 15105 | const variable = renderer.component.var_lookup.get(name); |
| 15106 | if (variable && (variable.subscribable && (variable.reassigned || variable.export_name))) { |
| 15107 | if (main_execution_context) { |
| 15108 | return x`${`$$subscribe_${name}`}(${value2 || name})`; |
| 15109 | } else { |
| 15110 | const member = renderer.context_lookup.get(name); |
| 15111 | return x`${`$$subscribe_${name}`}($$invalidate(${member.index}, ${value2 || name}))`; |
| 15112 | } |
| 15113 | } |
| 15114 | if (name[0] === "$" && name[1] !== "$") { |
| 15115 | return x`${name.slice(1)}.set(${value2 || name})`; |
| 15116 | } |
| 15117 | if (variable && (variable.module || !variable.referenced && !variable.is_reactive_dependency && !variable.export_name && !name.startsWith("$$"))) { |
| 15118 | return value2 || name; |
| 15119 | } |
| 15120 | if (value2) { |
| 15121 | if (main_execution_context) { |
| 15122 | return x`${value2}`; |
| 15123 | } else { |
| 15124 | const member = renderer.context_lookup.get(name); |
| 15125 | return x`$$invalidate(${member.index}, ${value2})`; |
| 15126 | } |
| 15127 | } |
| 15128 | if (main_execution_context) |
| 15129 | return; |
| 15130 | const deps = /* @__PURE__ */ new Set([name]); |
| 15131 | deps.forEach((name2) => { |
| 15132 | const reactive_declarations = renderer.component.reactive_declarations.filter((x2) => x2.assignees.has(name2)); |
| 15133 | reactive_declarations.forEach((declaration) => { |
| 15134 | declaration.dependencies.forEach((name3) => { |
| 15135 | deps.add(name3); |
| 15136 | }); |
| 15137 | }); |
| 15138 | }); |
| 15139 | const filtered = Array.from(deps).filter((n2) => renderer.context_lookup.has(n2)); |
| 15140 | if (!filtered.length) |
| 15141 | return null; |
| 15142 | return filtered.map((n2) => x`$$invalidate(${renderer.context_lookup.get(n2).index}, ${n2})`).reduce((lhs, rhs) => x`${lhs}, ${rhs}`); |
| 15143 | } |
| 15144 | function replace_object(node2, replacement) { |
| 15145 | if (node2.type === "Identifier") |
| 15146 | return replacement; |
no test coverage detected