fix svelte:self

pull/2198/head
Richard Harris 6 years ago
parent dd6a962f3e
commit 885ad257b7

@ -63,7 +63,7 @@ export default class InlineComponentWrapper extends Wrapper {
});
this.var = (
this.node.name === 'svelte:self' ? '__svelte:self__' : // TODO conflict-proof this
this.node.name === 'svelte:self' ? renderer.component.name :
this.node.name === 'svelte:component' ? 'switch_instance' :
this.node.name
).toLowerCase();
@ -452,7 +452,7 @@ export default class InlineComponentWrapper extends Wrapper {
block.builders.destroy.addLine(`if (${name}) ${name}.$destroy(${parentNode ? '' : 'detach'});`);
} else {
const expression = this.node.name === 'svelte:self'
? component.name
? '__svelte:self__' // TODO conflict-proof this
: component.qualify(this.node.name);
block.builders.init.addBlock(deindent`

Loading…
Cancel
Save