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';
77 * @param {Context } context
88 */
99export 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' ) {
1511 const field = context . state . state_fields ?. get ( `#${ node . property . name } ` ) ;
1612
1713 if ( field ?. type === '$derived' || field ?. type === '$derived.by' ) {
Original file line number Diff line number Diff line change 99 }
1010
1111 get embiggened1 () {
12- return this .#doubled;
12+ const self = this ;
13+ return self .#doubled;
1314 }
1415
1516 get embiggened2 () {
You can’t perform that action at this time.
0 commit comments