@@ -57,10 +57,7 @@ export function ClassBody(node, context) {
5757 e . state_field_duplicate ( node , name ) ;
5858 }
5959
60- const _key =
61- ( node . type === 'AssignmentExpression' || ! node . static ? '' : '@' ) +
62- ( key . type === 'PrivateIdentifier' ? '#' : '' ) +
63- name ;
60+ const _key = ( node . type === 'AssignmentExpression' || ! node . static ? '' : '@' ) + name ;
6461 const field = fields . get ( _key ) ;
6562
6663 // if there's already a method or assigned field, error
@@ -81,7 +78,7 @@ export function ClassBody(node, context) {
8178 for ( const child of node . body ) {
8279 if ( child . type === 'PropertyDefinition' && ! child . computed && ! child . static ) {
8380 handle ( child , child . key , child . value ) ;
84- const key = ( child . key . type === 'PrivateIdentifier' ? '#' : '' ) + get_name ( child . key ) ;
81+ const key = /** @ type { string } */ ( get_name ( child . key ) ) ;
8582 const field = fields . get ( key ) ;
8683 if ( ! field ) {
8784 fields . set ( key , [ child . value ? 'assigned_prop' : 'prop' ] ) ;
@@ -94,10 +91,7 @@ export function ClassBody(node, context) {
9491 if ( child . kind === 'constructor' ) {
9592 constructor = child ;
9693 } else if ( ! child . computed ) {
97- const key =
98- ( child . static ? '@' : '' ) +
99- ( child . key . type === 'PrivateIdentifier' ? '#' : '' ) +
100- get_name ( child . key ) ;
94+ const key = ( child . static ? '@' : '' ) + get_name ( child . key ) ;
10195 const field = fields . get ( key ) ;
10296 if ( ! field ) {
10397 fields . set ( key , [ child . kind ] ) ;
0 commit comments