mirror of https://github.com/sveltejs/svelte
fix: correctly transform reassignments to class fields in SSR mode (#16051)
* fix: correctly transform reassignments to class fields in SSR mode * add test, fix more stuff * fixpull/16054/head
parent
e5d0cd2eb4
commit
b5fcd112c6
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: correctly transform reassignments to class fields in SSR mode
|
@ -1,11 +1,14 @@
|
||||
<script>
|
||||
class Foo {
|
||||
a = $state();
|
||||
a = $state(0);
|
||||
#b = $state();
|
||||
|
||||
foo = $derived({ bar: this.a * 2 });
|
||||
bar = $derived({ baz: this.foo });
|
||||
constructor() {
|
||||
this.a = 1;
|
||||
this.#b = 2;
|
||||
this.foo.bar = 3;
|
||||
this.bar = 4;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in new issue