Skip to content

Commit 8fdb47d

Browse files
committed
fix: preserve key
1 parent ec016eb commit 8fdb47d

File tree

1 file changed

+4
-3
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+4
-3
lines changed

packages/svelte/src/internal/client/dom/blocks/each.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,10 @@ function reconcile(
481481
for (j = 0; j < length; j += 1) {
482482
var k = get_key(array[j], j);
483483
if (map.has(k)) {
484-
k = String(k);
485-
if (k.startsWith('[object ')) k = null;
486-
each_key_duplicate(String(j), String(map.get(k)), k);
484+
/** @type {string|null} */
485+
var key_name = String(k);
486+
if (key_name.startsWith('[object ')) key_name = null;
487+
each_key_duplicate(String(j), String(map.get(k)), key_name);
487488
}
488489
map.set(k, j);
489490
}

0 commit comments

Comments
 (0)