File tree 1 file changed +5
-2
lines changed
crates/oxc_transformer/src/es2022/class_properties
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,15 @@ impl<'a> ClassProperties<'a, '_> {
117
117
prop : & mut PropertyDefinition < ' a > ,
118
118
ctx : & TraverseCtx < ' a > ,
119
119
) {
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
+ }
122
124
123
125
// Debug checks that we're removing what we think we are
124
126
#[ cfg( debug_assertions) ]
125
127
{
128
+ let PropertyKey :: AssignmentExpression ( assign_expr) = & prop. key else { unreachable ! ( ) } ;
126
129
assert ! ( assign_expr. span. is_empty( ) ) ;
127
130
let AssignmentTarget :: AssignmentTargetIdentifier ( ident) = & assign_expr. left else {
128
131
unreachable ! ( ) ;
You can’t perform that action at this time.
0 commit comments