mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
perf(linter): swap the order of checks for no_caller (#844)
This commit is contained in:
parent
815db57a25
commit
6f270f1198
1 changed files with 7 additions and 7 deletions
|
|
@ -51,14 +51,14 @@ declare_oxc_lint!(
|
|||
|
||||
impl Rule for NoCaller {
|
||||
fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {
|
||||
let AstKind::MemberExpression(MemberExpression::StaticMemberExpression(expr)) = node.kind()
|
||||
else {
|
||||
return;
|
||||
};
|
||||
if expr.object.is_specific_id("arguments")
|
||||
&& (expr.property.name == "callee" || expr.property.name == "caller")
|
||||
if let AstKind::MemberExpression(MemberExpression::StaticMemberExpression(expr)) =
|
||||
node.kind()
|
||||
{
|
||||
ctx.diagnostic(NoCallerDiagnostic(expr.property.span));
|
||||
if (expr.property.name == "callee" || expr.property.name == "caller")
|
||||
&& expr.object.is_specific_id("arguments")
|
||||
{
|
||||
ctx.diagnostic(NoCallerDiagnostic(expr.property.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue