File tree Expand file tree Collapse file tree
crates/oxc_transformer/src/es2022/class_properties Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,12 +117,15 @@ impl<'a> ClassProperties<'a, '_> {
117117 prop : & mut PropertyDefinition < ' a > ,
118118 ctx : & TraverseCtx < ' a > ,
119119 ) {
120- // Exit if computed key is not an assignment (wasn't processed in 1st pass).
121- let PropertyKey :: AssignmentExpression ( assign_expr) = & prop. key else { return } ;
120+ // Exit if computed key is not an assignment (wasn't processed in 1st pass)
121+ if !matches ! ( & prop. key, PropertyKey :: AssignmentExpression ( _) ) {
122+ return ;
123+ }
122124
123125 // Debug checks that we're removing what we think we are
124126 #[ cfg( debug_assertions) ]
125127 {
128+ let PropertyKey :: AssignmentExpression ( assign_expr) = & prop. key else { unreachable ! ( ) } ;
126129 assert ! ( assign_expr. span. is_empty( ) ) ;
127130 let AssignmentTarget :: AssignmentTargetIdentifier ( ident) = & assign_expr. left else {
128131 unreachable ! ( ) ;
You can’t perform that action at this time.
0 commit comments