From 885ad257b7872c13561aa34445b3d1b8b2b41cff Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 10 Mar 2019 13:13:57 -0400 Subject: [PATCH] fix svelte:self --- src/compile/render-dom/wrappers/InlineComponent/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compile/render-dom/wrappers/InlineComponent/index.ts b/src/compile/render-dom/wrappers/InlineComponent/index.ts index 4abb81ea49..327eee59cf 100644 --- a/src/compile/render-dom/wrappers/InlineComponent/index.ts +++ b/src/compile/render-dom/wrappers/InlineComponent/index.ts @@ -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`