Skip to content

Commit 6c58013

Browse files
committed
simplify
1 parent b72f743 commit 6c58013

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ export function RegularElement(node, context) {
314314
state.options.preserveComments
315315
);
316316

317-
/** Whether or not we need to wrap the children in `{...}` to avoid declaration conflicts */
318-
const has_declaration = node.fragment.nodes.some((node) => node.type === 'SnippetBlock');
319-
320317
/** @type {typeof state} */
321318
const child_state = { ...state, init: [], update: [], after_update: [] };
322319

@@ -367,7 +364,8 @@ export function RegularElement(node, context) {
367364
}
368365
}
369366

370-
if (has_declaration) {
367+
if (node.fragment.nodes.some((node) => node.type === 'SnippetBlock')) {
368+
// Wrap children in `{...}` to avoid declaration conflicts
371369
context.state.init.push(
372370
b.block([
373371
...child_state.init,

0 commit comments

Comments
 (0)