|
|
|
@ -39,20 +39,19 @@ export function EachBlock(node, context) {
|
|
|
|
|
if (node.key) context.visit(node.key);
|
|
|
|
|
if (node.fallback) context.visit(node.fallback);
|
|
|
|
|
|
|
|
|
|
let mutated = false;
|
|
|
|
|
if (!context.state.analysis.runes) {
|
|
|
|
|
let mutated =
|
|
|
|
|
!!node.context &&
|
|
|
|
|
extract_identifiers(node.context).some((id) => {
|
|
|
|
|
const binding = context.state.scope.get(id.name);
|
|
|
|
|
return !!binding?.mutated;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// collect transitive dependencies...
|
|
|
|
|
for (const binding of node.metadata.expression.dependencies) {
|
|
|
|
|
collect_transitive_dependencies(binding, node.metadata.transitive_deps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (node.context) {
|
|
|
|
|
for (const id of extract_identifiers(node.context)) {
|
|
|
|
|
const binding = context.state.scope.get(id.name);
|
|
|
|
|
if (binding?.mutated) mutated = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ...and ensure they are marked as state, so they can be turned
|
|
|
|
|
// into mutable sources and invalidated
|
|
|
|
|
if (mutated) {
|
|
|
|
@ -67,6 +66,7 @@ export function EachBlock(node, context) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mark_subtree_dynamic(context.path);
|
|
|
|
|
}
|
|
|
|
|