mirror of https://github.com/sveltejs/svelte
fix: add `UNKNOWN` evaluation value before breaking for `binding.initial===SnippetBlock` (#16910)
parent
edcd4b59e3
commit
1b1f144396
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: add `UNKNOWN` evaluation value before breaking for `binding.initial===SnippetBlock`
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
let { test } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{@render test?.()}
|
@ -0,0 +1,10 @@
|
|||||||
|
import { flushSync } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
async test({ assert, target }) {
|
||||||
|
const btn = target.querySelector('button');
|
||||||
|
flushSync(() => btn?.click());
|
||||||
|
assert.htmlEqual(target.innerHTML, `<button></button><p>snip</p>`);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,15 @@
|
|||||||
|
<script>
|
||||||
|
import Component from "./Component.svelte";
|
||||||
|
let count = $state(0);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#snippet snip()}
|
||||||
|
<p>snip</p>
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
|
<button onclick={() => count++}></button>
|
||||||
|
{#if true}
|
||||||
|
{@const test = count % 2 === 0 ? undefined: snip}
|
||||||
|
<Component {test} />
|
||||||
|
{/if}
|
||||||
|
|
Loading…
Reference in new issue