Skip to content

Commit 13da930

Browse files
committed
chore: apply smart suggestion
1 parent 727839b commit 13da930

File tree

1 file changed

+5
-4
lines changed
  • packages/svelte/src/compiler/migrate

1 file changed

+5
-4
lines changed

packages/svelte/src/compiler/migrate/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,11 @@ const template = {
763763
);
764764
// if it has a fragment we need to overwrite the closing tag too
765765
if (node.fragment.nodes.length > 0) {
766-
const start_closing =
767-
state.str.original.indexOf('<', node.fragment.nodes[node.fragment.nodes.length - 1].end) +
768-
2;
769-
state.str.overwrite(start_closing, node.end - 1, `${state.names.svelte_self}`);
766+
state.str.overwrite(
767+
state.str.original.lastIndexOf('<', node.end) + 2,
768+
node.end - 1,
769+
`${state.names.svelte_self}`
770+
);
770771
} else if (!source.endsWith('/>')) {
771772
// special case for case `<svelte:self></svelte:self>` it has no fragment but
772773
// we still need to overwrite the end tag

0 commit comments

Comments
 (0)