mirror of https://github.com/sveltejs/svelte
fix: generate correct code for `each` blocks with async body (#16923)
* fix: generate correct code for `each` blocks with async body * fix: else branch of `each` block * chore: add expected htmlpull/16607/merge
parent
7f8e60fd8a
commit
297afd0578
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: generate correct code for `each` blocks with async body
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
mode: ['async']
|
||||
});
|
@ -0,0 +1 @@
|
||||
<!--[--><!--[--><!--[--><!---->each<!--]--><!--]--> <!--[--><!--[!--><!---->else<!--]--><!--]--><!--]-->
|
@ -0,0 +1,11 @@
|
||||
{#each { length: 1 }}
|
||||
{@const data = await Promise.resolve("each")}
|
||||
{data}
|
||||
{/each}
|
||||
|
||||
{#each { length: 0 }}
|
||||
should not see this
|
||||
{:else}
|
||||
{@const data = await Promise.resolve("else")}
|
||||
{data}
|
||||
{/each}
|
Loading…
Reference in new issue