mirror of https://github.com/sveltejs/svelte
fix: ensure snippet hoisting works in the correct scope (#14642)
* fix: ensure snippet hoisting works in the correct scope * fix bug * revert * revertpull/14656/head
parent
9cfd2e20ab
commit
66e30d3288
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure snippet hoisting works in the correct scope
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: 'a'
|
||||
});
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
let abc = 'a'
|
||||
</script>
|
||||
|
||||
{@render b()}
|
||||
|
||||
{#snippet a()}
|
||||
{abc}
|
||||
{/snippet}
|
||||
|
||||
{#snippet b()}
|
||||
{@render a()}
|
||||
{/snippet}
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: '<h1>Hello world!</h1>'
|
||||
});
|
@ -0,0 +1,13 @@
|
||||
<script module>
|
||||
export { foo }
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let name = 'world';
|
||||
</script>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
||||
|
||||
{#snippet foo()}
|
||||
oo
|
||||
{/snippet}
|
Loading…
Reference in new issue