From 49df9883723193ccd9e757fb4795e347ec4ea4ad Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 27 Oct 2025 16:08:06 +0100 Subject: [PATCH] fix --- .../src/compiler/phases/2-analyze/visitors/SnippetBlock.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js b/packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js index 7930c2b1a7..c0350f8e6f 100644 --- a/packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js +++ b/packages/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js @@ -81,8 +81,13 @@ export function SnippetBlock(node, context) { function can_hoist_snippet(scope, scopes, visited = new Set()) { for (const [reference] of scope.references) { const binding = scope.get(reference); + if (!binding) continue; - if (!binding || binding.scope.function_depth === 0) { + if (binding.blocker) { + return false; + } + + if (binding.scope.function_depth === 0) { continue; }