@@ -474,7 +474,7 @@ fn gen_class_prop<'a>(node: &'a ClassProp, context: &mut Context<'a>) -> PrintIt
474
474
type_ann : & node. type_ann ,
475
475
is_static : node. is_static ( ) ,
476
476
decorators : & node. decorators ,
477
- computed : node. computed ( ) ,
477
+ computed : node. key . kind ( ) == NodeKind :: ComputedPropName ,
478
478
is_declare : node. declare ( ) ,
479
479
accessibility : node. accessibility ( ) ,
480
480
is_abstract : node. is_abstract ( ) ,
@@ -599,11 +599,16 @@ fn gen_class_prop_common<'a>(node: GenClassPropCommon<'a>, context: &mut Context
599
599
if node. readonly {
600
600
items. push_str ( "readonly " ) ;
601
601
}
602
- let key_span = node. key . span ( ) ;
603
602
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
+ } ;
604
607
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
+ } ,
607
612
context,
608
613
)
609
614
} else {
0 commit comments