File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
src/compiler/phases/3-transform/server/visitors
tests/runtime-runes/samples/class-state-derived-private Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ fix: correctly transform ` $derived ` private fields on server
Original file line number Diff line number Diff line change @@ -7,11 +7,7 @@ import * as b from '#compiler/builders';
7
7
* @param {Context } context
8
8
*/
9
9
export function MemberExpression ( node , context ) {
10
- if (
11
- context . state . analysis . runes &&
12
- node . object . type === 'ThisExpression' &&
13
- node . property . type === 'PrivateIdentifier'
14
- ) {
10
+ if ( context . state . analysis . runes && node . property . type === 'PrivateIdentifier' ) {
15
11
const field = context . state . state_fields ?. get ( `#${ node . property . name } ` ) ;
16
12
17
13
if ( field ?. type === '$derived' || field ?. type === '$derived.by' ) {
Original file line number Diff line number Diff line change 9
9
}
10
10
11
11
get embiggened1 () {
12
- return this .#doubled;
12
+ const self = this ;
13
+ return self .#doubled;
13
14
}
14
15
15
16
get embiggened2 () {
You can’t perform that action at this time.
0 commit comments