Merge pull request #2286 from sveltejs/gh-2284

find this= in <svelte:component> in presence of bind:this=
pull/2307/head
Rich Harris 6 years ago committed by GitHub
commit da1e061cda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

Loading…
Cancel
Save