fix: print `{#await}` blocks that only have a pending branch (#18908)

pull/18821/merge
Fatih Çakır 15 hours ago committed by GitHub
parent f382705328
commit 14136f88fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: print `{#await}` blocks that only have a pending branch

@ -754,7 +754,9 @@ const svelte_visitors = (comments, state) => ({
if (node.pending) {
context.write('}');
block(context, node.pending, state.preserve_whitespace > 0);
context.write('{:');
if (node.then || node.catch) {
context.write('{:');
}
} else {
context.write(' ');
}

@ -34,3 +34,7 @@
{:catch}
<p>Something went wrong</p>
{/await}
{#await promise}
<p>waiting for the promise to resolve...</p>
{/await}

@ -34,3 +34,7 @@
{:catch}
<p>Something went wrong</p>
{/await}
{#await promise}
<p>waiting for the promise to resolve...</p>
{/await}

Loading…
Cancel
Save