Skip to content

Commit 46cbdd4

Browse files
committed
address feedback
1 parent 05d6658 commit 46cbdd4

File tree

1 file changed

+6
-1
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,12 @@ export const template_visitors = {
22092209
);
22102210

22112211
if (init.length !== 0 || update.length !== 0 || after_update.length !== 0) {
2212-
context.state.init.push(b.block([...init, serialize_render_stmt(update), ...after_update]));
2212+
const block = b.block([...init]);
2213+
if (update.length > 0) {
2214+
block.body.push(serialize_render_stmt(update));
2215+
}
2216+
block.body.push(...after_update);
2217+
context.state.init.push(block);
22132218
}
22142219

22152220
if (has_direction_attribute) {

0 commit comments

Comments
 (0)