diff --git a/src/compiler/compile/render_dom/wrappers/shared/create_debugging_comment.ts b/src/compiler/compile/render_dom/wrappers/shared/create_debugging_comment.ts index 1bdc473df0db..6e295f99c125 100644 --- a/src/compiler/compile/render_dom/wrappers/shared/create_debugging_comment.ts +++ b/src/compiler/compile/render_dom/wrappers/shared/create_debugging_comment.ts @@ -29,7 +29,7 @@ export default function create_debugging_comment( } else { // @ts-ignore 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; } diff --git a/test/runtime/samples/component-slot-slot/Component.svelte b/test/runtime/samples/component-slot-slot/Component.svelte new file mode 100644 index 000000000000..fdcb8e7f2b7d --- /dev/null +++ b/test/runtime/samples/component-slot-slot/Component.svelte @@ -0,0 +1,3 @@ +
+ +
diff --git a/test/runtime/samples/component-slot-slot/Forward.svelte b/test/runtime/samples/component-slot-slot/Forward.svelte new file mode 100644 index 000000000000..320be9df2506 --- /dev/null +++ b/test/runtime/samples/component-slot-slot/Forward.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/test/runtime/samples/component-slot-slot/_config.js b/test/runtime/samples/component-slot-slot/_config.js new file mode 100644 index 000000000000..32af774fac2a --- /dev/null +++ b/test/runtime/samples/component-slot-slot/_config.js @@ -0,0 +1,3 @@ +export default { + html: '
lol
' +}; diff --git a/test/runtime/samples/component-slot-slot/main.svelte b/test/runtime/samples/component-slot-slot/main.svelte new file mode 100644 index 000000000000..1718494b16dc --- /dev/null +++ b/test/runtime/samples/component-slot-slot/main.svelte @@ -0,0 +1,9 @@ + + + + + lol + +