mirror of https://github.com/sveltejs/svelte
parent
396ea2ef37
commit
546a82922c
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure internal cloning can work circular values
|
||||
@ -0,0 +1,15 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
|
||||
async test({ assert, logs }) {
|
||||
var a = {
|
||||
a: null
|
||||
};
|
||||
a.a = a;
|
||||
assert.deepEqual(logs, ['init', { a }]);
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
class A {
|
||||
toJSON(){
|
||||
return {
|
||||
a: this
|
||||
}
|
||||
}
|
||||
}
|
||||
const state = $state(new A());
|
||||
$inspect(state);
|
||||
</script>
|
||||
Loading…
Reference in new issue