fix: ensure compiler statements are correctly included (#14074)

Fixes #14068 and fixes #14071
pull/14075/head
Dominic Gannaway 5 days ago committed by GitHub
parent 3b38bc2a77
commit 2bdc3d401f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure compiler statements are correctly included

@ -401,6 +401,7 @@ export function RegularElement(node, context) {
context.state.init.push(
b.block([
...child_state.init,
...element_state.init,
child_state.update.length > 0 ? build_render_statement(child_state.update) : b.empty,
...child_state.after_update,
...element_state.after_update

@ -0,0 +1,8 @@
import { test } from '../../test';
export default test({
compileOptions: {
dev: true // Render in dev mode to check that the validation error is not thrown
},
html: `<form></form>\nundefined`
});

@ -0,0 +1,11 @@
<script>
let thisBug;
</script>
<form bind:this={thisBug}>
{#snippet Bug()}
cool
{/snippet}
</form>
{typeof thisBug}
Loading…
Cancel
Save