fix compiler hanging on <slot slot="..."> (#5536)

pull/5564/head
Damián Pumar 4 years ago committed by GitHub
parent 40c850d3e7
commit 5d480c5d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,7 +29,7 @@ export default function create_debugging_comment(
} else { } else {
// @ts-ignore // @ts-ignore
d = node.expression ? node.expression.node.end : c; d = node.expression ? node.expression.node.end : c;
while (source[d] !== '}') d += 1; while (source[d] !== '}' && d <= source.length) d += 1;
while (source[d] === '}') d += 1; while (source[d] === '}') d += 1;
} }

@ -0,0 +1,3 @@
<div>
<slot name="test" />
</div>

@ -0,0 +1,7 @@
<script>
import Component from './Component.svelte';
</script>
<Component>
<slot slot="test" />
</Component>

@ -0,0 +1,3 @@
export default {
html: '<div><span>lol</span></div>'
};

@ -0,0 +1,9 @@
<script>
import Forward from './Forward.svelte';
</script>
<Forward>
<span>
lol
</span>
</Forward>
Loading…
Cancel
Save