mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
refactor(transformer/class-properties): fix lint warning in release mode (#8539)
Fix a lint warning which only occurs in release mode.
This commit is contained in:
parent
991a22f907
commit
72f425f074
1 changed files with 5 additions and 2 deletions
|
|
@ -117,12 +117,15 @@ impl<'a> ClassProperties<'a, '_> {
|
|||
prop: &mut PropertyDefinition<'a>,
|
||||
ctx: &TraverseCtx<'a>,
|
||||
) {
|
||||
// Exit if computed key is not an assignment (wasn't processed in 1st pass).
|
||||
let PropertyKey::AssignmentExpression(assign_expr) = &prop.key else { return };
|
||||
// Exit if computed key is not an assignment (wasn't processed in 1st pass)
|
||||
if !matches!(&prop.key, PropertyKey::AssignmentExpression(_)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Debug checks that we're removing what we think we are
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let PropertyKey::AssignmentExpression(assign_expr) = &prop.key else { unreachable!() };
|
||||
assert!(assign_expr.span.is_empty());
|
||||
let AssignmentTarget::AssignmentTargetIdentifier(ident) = &assign_expr.left else {
|
||||
unreachable!();
|
||||
|
|
|
|||
Loading…
Reference in a new issue