Merge pull request #2431 from Panya/issue-2429

Fix creation of debugging comment for elements without children
pull/2434/head
Rich Harris 6 years ago committed by GitHub
commit 519059f7d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,7 @@ export default function create_debugging_comment(
let d;
if (node.type === 'InlineComponent' || node.type === 'Element') {
d = node.children[0].start;
d = node.children.length ? node.children[0].start : node.start;
while (source[d - 1] !== '>') d -= 1;
} else {
d = node.expression ? node.expression.node.end : c;

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

@ -0,0 +1,3 @@
export default {
html: `<div><input slot="slot1"></div>`
};

@ -0,0 +1,6 @@
<script>
import Nested from "./Nested.svelte";
</script>
<Nested>
<input slot="slot1">
</Nested>
Loading…
Cancel
Save