@@ -474,7 +474,7 @@ fn gen_class_prop<'a>(node: &'a ClassProp, context: &mut Context<'a>) -> PrintIt
474474 type_ann : & node. type_ann ,
475475 is_static : node. is_static ( ) ,
476476 decorators : & node. decorators ,
477- computed : node. computed ( ) ,
477+ computed : node. key . kind ( ) == NodeKind :: ComputedPropName ,
478478 is_declare : node. declare ( ) ,
479479 accessibility : node. accessibility ( ) ,
480480 is_abstract : node. is_abstract ( ) ,
@@ -599,11 +599,16 @@ fn gen_class_prop_common<'a>(node: GenClassPropCommon<'a>, context: &mut Context
599599 if node. readonly {
600600 items. push_str ( "readonly " ) ;
601601 }
602- let key_span = node. key . span ( ) ;
603602 items. extend ( if node. computed {
603+ let inner_key_node = match node. key {
604+ Node :: ComputedPropName ( prop) => prop. expr . as_node ( ) ,
605+ _ => node. key ,
606+ } ;
604607 gen_computed_prop_like (
605- |context| gen_node ( node. key , context) ,
606- GenComputedPropLikeOptions { inner_node_span : key_span } ,
608+ |context| gen_node ( inner_key_node, context) ,
609+ GenComputedPropLikeOptions {
610+ inner_node_span : inner_key_node. span ( ) ,
611+ } ,
607612 context,
608613 )
609614 } else {
0 commit comments