From 97b4c730df6cb5e7ddae5c3945f76c8dc11dd4ed Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Tue, 17 Mar 2020 08:04:35 +0800 Subject: [PATCH] fix create debugging comment for comment --- .../render_dom/wrappers/shared/create_debugging_comment.ts | 2 +- test/runtime/samples/component-slot-fallback-4/Inner.svelte | 3 +++ test/runtime/samples/component-slot-fallback-4/_config.js | 5 +++++ test/runtime/samples/component-slot-fallback-4/main.svelte | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/runtime/samples/component-slot-fallback-4/Inner.svelte create mode 100644 test/runtime/samples/component-slot-fallback-4/_config.js create mode 100644 test/runtime/samples/component-slot-fallback-4/main.svelte 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 11f1feb841..1bdc473df0 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 @@ -24,7 +24,7 @@ export default function create_debugging_comment( while (source[d] !== '>') d += 1; d += 1; } - } else if (node.type === 'Text') { + } else if (node.type === 'Text' || node.type === 'Comment') { d = node.end; } else { // @ts-ignore diff --git a/test/runtime/samples/component-slot-fallback-4/Inner.svelte b/test/runtime/samples/component-slot-fallback-4/Inner.svelte new file mode 100644 index 0000000000..9eb3ef1401 --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-4/Inner.svelte @@ -0,0 +1,3 @@ + + + foobar \ No newline at end of file diff --git a/test/runtime/samples/component-slot-fallback-4/_config.js b/test/runtime/samples/component-slot-fallback-4/_config.js new file mode 100644 index 0000000000..b7c2b63ed6 --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-4/_config.js @@ -0,0 +1,5 @@ +export default { + html: ` + foobar + `, +}; diff --git a/test/runtime/samples/component-slot-fallback-4/main.svelte b/test/runtime/samples/component-slot-fallback-4/main.svelte new file mode 100644 index 0000000000..206ce21def --- /dev/null +++ b/test/runtime/samples/component-slot-fallback-4/main.svelte @@ -0,0 +1,5 @@ + + +