allow non-existent dynamic components to be destroyed (#1660)

pull/1677/head
Rich Harris 6 years ago
parent 3778431775
commit 620077227f

@ -505,7 +505,7 @@ export default class Component extends Node {
if (this.compiler.options.nestedTransitions) { if (this.compiler.options.nestedTransitions) {
block.builders.outro.addLine( block.builders.outro.addLine(
`${name}._fragment.o(#outrocallback);` `if (${name}) ${name}._fragment.o(#outrocallback);`
); );
} }
} }

@ -0,0 +1,13 @@
export default {
data: {
x: true
},
nestedTransitions: true,
test(assert, component) {
component.set({
x: false
});
}
};

@ -0,0 +1,3 @@
{#if x}
<svelte:component this={null}/>
{/if}
Loading…
Cancel
Save