Skip to content

Commit b5148d3

Browse files
committed
fix: ensure $state.snapshot clones holey arrays correctly
1 parent 0eb8aae commit b5148d3

File tree

1 file changed

+1
-1
lines changed
  • packages/svelte/src/internal/shared

1 file changed

+1
-1
lines changed

packages/svelte/src/internal/shared/clone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function clone(value, cloned, path, paths, original = null) {
7070

7171
for (var i = 0; i < value.length; i += 1) {
7272
var element = value[i];
73-
if (i in element) {
73+
if (i in value) {
7474
copy[i] = clone(element, cloned, DEV ? `${path}[${i}]` : path, paths);
7575
}
7676
}

0 commit comments

Comments
 (0)