mirror of https://github.com/sveltejs/svelte
fix: prevent writable store value from becoming a proxy when reassigning using $-prefix (#15283)
fixes #15281pull/15319/head
parent
dde8603872
commit
073f4d8911
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: prevent writable store value from becoming a proxy when reassigning using $-prefix
|
@ -0,0 +1,7 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
async test({ target, assert }) {
|
||||||
|
assert.htmlEqual(target.innerHTML, `<p>bar</p>`);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
|
const obj = writable({ name: 'foo' });
|
||||||
|
|
||||||
|
$obj = { name: 'bar' };
|
||||||
|
|
||||||
|
const clone = structuredClone($obj);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>{clone.name}</p>
|
Loading…
Reference in new issue