Skip to content

Commit 29e6424

Browse files
committed
feat: remove $.unwrap calls from each block indexes
1 parent d8212f4 commit 29e6424

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/dry-hotels-matter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: remove $.unwrap calls from each block indexes

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2556,7 +2556,9 @@ export const template_visitors = {
25562556
if (node.index) {
25572557
child_state.getters[node.index] = (id) => {
25582558
const index_with_loc = with_loc(index, id);
2559-
return b.call('$.unwrap', index_with_loc);
2559+
return (flags & EACH_INDEX_REACTIVE) === 0
2560+
? index_with_loc
2561+
: b.call('$.get', index_with_loc);
25602562
};
25612563

25622564
key_state.getters[node.index] = b.id(node.index);

0 commit comments

Comments
 (0)