find this= in <svelte:component> in presence of bind:this= (#2284)

pull/2286/head
Conduitry 6 years ago
parent d6b9991d3d
commit d10fa72cf4

@ -191,8 +191,7 @@ export default function tag(parser: Parser) {
}
if (name === 'svelte:component') {
// TODO post v2, treat this just as any other attribute
const index = element.attributes.findIndex(attr => attr.name === 'this');
const index = element.attributes.findIndex(attr => attr.type === 'Attribute' && attr.name === 'this');
if (!~index) {
parser.error({
code: `missing-component-definition`,

@ -4,4 +4,4 @@
export let test;
</script>
<svelte:component this={Foo} bind:this={test}/>
<svelte:component bind:this={test} this={Foo}/>

Loading…
Cancel
Save