Skip to content

Commit

Permalink
perf(semantic): just need to find the AstKind::FormalParameter in is_…
Browse files Browse the repository at this point in the history
…in_formal_parameters
  • Loading branch information
Dunqing committed Dec 29, 2023
1 parent 0e0f258 commit 2198935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/checker/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ fn check_unary_expression<'a>(
fn is_in_formal_parameters<'a>(node: &AstNode<'a>, ctx: &SemanticBuilder<'a>) -> bool {
for node_id in ctx.nodes.ancestors(node.id()).skip(1) {
match ctx.nodes.kind(node_id) {
AstKind::FormalParameters(_) => return true,
AstKind::FormalParameter(_) => return true,
AstKind::Program(_) | AstKind::Function(_) | AstKind::ArrowExpression(_) => break,
_ => {}
}
Expand Down

0 comments on commit 2198935

Please sign in to comment.