the fallback is visited with the expression, outside the block's scope

each-fallback-scope
Nic 11 hours ago
parent fd1bf6c7a3
commit 458050843a

@ -1233,6 +1233,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
EachBlock(node, { state, visit }) { EachBlock(node, { state, visit }) {
visit(node.expression); visit(node.expression);
if (node.fallback) visit(node.fallback);
// context and children are a new scope // context and children are a new scope
const scope = state.scope.child(); const scope = state.scope.child();
@ -1278,7 +1279,6 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
for (const child of node.body.nodes) { for (const child of node.body.nodes) {
visit(child, { scope }); visit(child, { scope });
} }
if (node.fallback) visit(node.fallback);
node.metadata = { node.metadata = {
expression: new ExpressionMetadata(), expression: new ExpressionMetadata(),

Loading…
Cancel
Save