Skip to content

Commit

Permalink
fix: ensure compiler statements are correctly included (#14074)
Browse files Browse the repository at this point in the history
Fixes #14068 and fixes #14071
  • Loading branch information
trueadm authored Oct 31, 2024
1 parent 3b38bc2 commit 2bdc3d4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-peas-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: ensure compiler statements are correctly included
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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`
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script>
let thisBug;
</script>

<form bind:this={thisBug}>
{#snippet Bug()}
cool
{/snippet}
</form>

{typeof thisBug}

0 comments on commit 2bdc3d4

Please sign in to comment.