From 5c784e238dda455f45b4739f6d0b79ab2e58403e Mon Sep 17 00:00:00 2001 From: ComputerGuy <63362464+Ocean-OS@users.noreply.github.com> Date: Wed, 6 Aug 2025 18:05:29 -0700 Subject: [PATCH] add failing test --- .../phases/3-transform/client/visitors/SvelteBoundary.js | 4 ++-- .../tests/runtime-runes/samples/async-const/_config.js | 2 +- .../tests/runtime-runes/samples/async-const/main.svelte | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js index ae7f199621..b000559973 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js @@ -69,13 +69,13 @@ export function SvelteBoundary(node, context) { if (node.fragment.metadata.has_await) { // we have to make sure the `$.suspend` goes before everything else snippet_fn.body.body.splice( - dev ? 2 : 1, + dev ? 3 : 2, 0, ...const_tags.filter((node) => node.type === 'VariableDeclaration') ); } else { snippet_fn.body.body.splice( - dev ? 1 : 0, + dev ? 2 : 1, 0, ...const_tags.filter((node) => node.type === 'VariableDeclaration') ); diff --git a/packages/svelte/tests/runtime-runes/samples/async-const/_config.js b/packages/svelte/tests/runtime-runes/samples/async-const/_config.js index 084d9c3874..8aeca875f3 100644 --- a/packages/svelte/tests/runtime-runes/samples/async-const/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/async-const/_config.js @@ -7,6 +7,6 @@ export default test({ async test({ assert, target }) { await tick(); - assert.htmlEqual(target.innerHTML, `