From d10fa72cf493852611c9790f220a3ce63ff4056b Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 21 Mar 2019 16:46:59 -0400 Subject: [PATCH] find this= in in presence of bind:this= (#2284) --- src/parse/state/tag.ts | 3 +-- test/runtime/samples/dynamic-component-ref/main.svelte | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index dc7c0c3d5a..3747d2d482 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -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`, diff --git a/test/runtime/samples/dynamic-component-ref/main.svelte b/test/runtime/samples/dynamic-component-ref/main.svelte index 984f34fc7b..a7e8643cc4 100644 --- a/test/runtime/samples/dynamic-component-ref/main.svelte +++ b/test/runtime/samples/dynamic-component-ref/main.svelte @@ -4,4 +4,4 @@ export let test; - +