diff --git a/src/compiler/compile/render_dom/Block.ts b/src/compiler/compile/render_dom/Block.ts index 1352464d4e..460c3ad870 100644 --- a/src/compiler/compile/render_dom/Block.ts +++ b/src/compiler/compile/render_dom/Block.ts @@ -226,7 +226,9 @@ export default class Block { const { dev } = this.renderer.options; if (this.has_outros) { - this.add_variable({ type: 'Identifier', name: '#current' }); + + this.add_variable({ type: 'Identifier', name: '#current' }, + this.chunks.intro.length === 0 ? x`true` : undefined); if (this.chunks.intro.length > 0) { this.chunks.intro.push(b`#current = true;`); diff --git a/test/runtime/samples/reactive-mixed-slots/Component.svelte b/test/runtime/samples/reactive-mixed-slots/Component.svelte new file mode 100644 index 0000000000..e08f5ddd6d --- /dev/null +++ b/test/runtime/samples/reactive-mixed-slots/Component.svelte @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/test/runtime/samples/reactive-mixed-slots/Empty.svelte b/test/runtime/samples/reactive-mixed-slots/Empty.svelte new file mode 100644 index 0000000000..f0b453d298 --- /dev/null +++ b/test/runtime/samples/reactive-mixed-slots/Empty.svelte @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/runtime/samples/reactive-mixed-slots/_config.js b/test/runtime/samples/reactive-mixed-slots/_config.js new file mode 100644 index 0000000000..a638edfe5d --- /dev/null +++ b/test/runtime/samples/reactive-mixed-slots/_config.js @@ -0,0 +1,15 @@ +export default { + html: ` +
+ ___init + `, + + test({ assert, component, target }) { + component.value = 'update'; + + assert.htmlEqual(target.innerHTML, ` +
+ ___update + `); + } +}; diff --git a/test/runtime/samples/reactive-mixed-slots/main.svelte b/test/runtime/samples/reactive-mixed-slots/main.svelte new file mode 100644 index 0000000000..fbb4e29394 --- /dev/null +++ b/test/runtime/samples/reactive-mixed-slots/main.svelte @@ -0,0 +1,11 @@ + + + +
+ ___{value} +
\ No newline at end of file