Skip to content

Commit

Permalink
refactor(semantic): use Expression::is_super (#7851)
Browse files Browse the repository at this point in the history
Shorten code by using `Expression::is_super`, which was introduced in #7831.
  • Loading branch information
overlookmotel committed Dec 13, 2024
1 parent e49de81 commit 5d42df8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_semantic/src/checker/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,8 @@ fn super_private(span: Span) -> OxcDiagnostic {

pub fn check_member_expression(member_expr: &MemberExpression, ctx: &SemanticBuilder<'_>) {
if let MemberExpression::PrivateFieldExpression(private_expr) = member_expr {
// super.#m
if let Expression::Super(_) = &private_expr.object {
// `super.#m`
if private_expr.object.is_super() {
ctx.error(super_private(private_expr.span));
}
}
Expand Down

0 comments on commit 5d42df8

Please sign in to comment.