@@ -546,6 +546,28 @@ export const validation_runes_js = {
546546 } ,
547547 UpdateExpression ( node , { state } ) {
548548 validate_assignment ( node , node . argument , state ) ;
549+ } ,
550+ ClassBody ( node , context ) {
551+ /** @type {string[] } */
552+ const private_derived_state = [ ] ;
553+
554+ for ( const definition of node . body ) {
555+ if (
556+ definition . type === 'PropertyDefinition' &&
557+ definition . key . type === 'PrivateIdentifier' &&
558+ definition . value ?. type === 'CallExpression'
559+ ) {
560+ const rune = get_rune ( definition . value , context . state . scope ) ;
561+ if ( rune === '$derived' ) {
562+ private_derived_state . push ( definition . key . name ) ;
563+ }
564+ }
565+ }
566+
567+ context . next ( {
568+ ...context . state ,
569+ private_derived_state
570+ } ) ;
549571 }
550572} ;
551573
@@ -688,26 +710,5 @@ export const validation_runes = merge(validation, a11y_validators, {
688710 }
689711 }
690712 } ,
691- ClassBody ( node , context ) {
692- /** @type {string[] } */
693- const private_derived_state = [ ] ;
694-
695- for ( const definition of node . body ) {
696- if (
697- definition . type === 'PropertyDefinition' &&
698- definition . key . type === 'PrivateIdentifier' &&
699- definition . value ?. type === 'CallExpression'
700- ) {
701- const rune = get_rune ( definition . value , context . state . scope ) ;
702- if ( rune === '$derived' ) {
703- private_derived_state . push ( definition . key . name ) ;
704- }
705- }
706- }
707-
708- context . next ( {
709- ...context . state ,
710- private_derived_state
711- } ) ;
712- }
713+ ClassBody : validation_runes_js . ClassBody
713714} ) ;
0 commit comments