Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/parser/converts/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ export function convertIfBlock(
});
const consequent = getConsequentFromIfBlock(node);

ifBlock.children.push(
...convertChildren(
{
nodes:
// Adjust for Svelte v5
trimChildren(getChildren(consequent)),
},
ifBlock,
ctx,
),
);
for (const child of convertChildren(
{
nodes:
// Adjust for Svelte v5
trimChildren(getChildren(consequent)),
},
ifBlock,
ctx,
)) {
ifBlock.children.push(child);
}

ctx.scriptLet.closeScope();
if (elseif) {
Expand Down Expand Up @@ -218,17 +218,17 @@ export function convertIfBlock(
ifBlock.else = elseBlock;

ctx.scriptLet.nestBlock(elseBlock);
elseBlock.children.push(
...convertChildren(
{
nodes:
// Adjust for Svelte v5
trimChildren(elseChildren),
},
elseBlock,
ctx,
),
);
for (const child of convertChildren(
{
nodes:
// Adjust for Svelte v5
trimChildren(elseChildren),
},
elseBlock,
ctx,
)) {
elseBlock.children.push(child);
}
ctx.scriptLet.closeScope();
extractMustacheBlockTokens(elseBlock, ctx, { startOnly: true });

Expand Down
Loading