From 5d42df8dd6c78bc9e875b2b7ef0b88a43fc1a964 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:35:13 +0000 Subject: [PATCH] refactor(semantic): use `Expression::is_super` (#7851) Shorten code by using `Expression::is_super`, which was introduced in #7831. --- crates/oxc_semantic/src/checker/javascript.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/oxc_semantic/src/checker/javascript.rs b/crates/oxc_semantic/src/checker/javascript.rs index be64aec7652d9..7c5fe941a5f49 100644 --- a/crates/oxc_semantic/src/checker/javascript.rs +++ b/crates/oxc_semantic/src/checker/javascript.rs @@ -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)); } }