Skip to content

Commit b41ef82

Browse files
committed
is_class_extends
1 parent d599e7c commit b41ef82

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

crates/oxc_formatter/src/parentheses/expression.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,7 @@ fn is_in_for_initializer(expr: &AstNode<'_, BinaryExpression<'_>>) -> bool {
367367
impl<'a> NeedsParentheses<'a> for AstNode<'a, PrivateInExpression<'a>> {
368368
#[inline]
369369
fn needs_parentheses(&self, f: &Formatter<'_, 'a>) -> bool {
370-
match self.parent {
371-
AstNodes::Class(ty) => {
372-
if let Some(super_class) = ty.super_class() {
373-
super_class.span() == self.span()
374-
} else {
375-
false
376-
}
377-
}
378-
_ => false,
379-
}
370+
is_class_extends(self.span, self.parent)
380371
}
381372
}
382373

0 commit comments

Comments
 (0)