mirror of https://github.com/sveltejs/svelte
fix: ensure $state.snapshot clones holey arrays correctly (#14657)
* fix: ensure $state.snapshot clones holey arrays correctly * fix: ensure $state.snapshot clones holey arrays correctly * fix: ensure $state.snapshot clones holey arrays correctly * fix: ensure $state.snapshot clones holey arrays correctlypull/14652/head
parent
ab1f7f437e
commit
fb879dd702
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: ensure $state.snapshot clones holey arrays correctly
|
@ -0,0 +1,5 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
html: `<div>false</div><div>true</div>`
|
||||||
|
});
|
@ -0,0 +1,10 @@
|
|||||||
|
<script>
|
||||||
|
let arr = []
|
||||||
|
arr[5] = true
|
||||||
|
|
||||||
|
let state = $state([])
|
||||||
|
state[5] = true
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>{2 in $state.snapshot(state)}</div>
|
||||||
|
<div>{5 in $state.snapshot(state)}</div>
|
Loading…
Reference in new issue