mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
perf(semantic): skip arguments ancestry checks outside classes (#28510)
Skip ContainsArguments ancestor traversal when no class is active; retain field initializer and static block checks. AI-assisted (Codex).
This commit is contained in:
1 parent
cf81d074eb
commit
d85ee3db01
1 file changed
+1
-1
@@ -316,7 +316,7 @@ pub fn check_identifier_reference(ident: &IdentifierReference, ctx: &SemanticBui
|
||||
// ClassStaticBlockBody : ClassStaticBlockStatementList
|
||||
// It is a Syntax Error if ContainsArguments of ClassStaticBlockStatementList is true.
|
||||
|
||||
if ident.name == "arguments" {
|
||||
if ident.name == "arguments" && ctx.class_table_builder.current_class_id.is_some() {
|
||||
let mut previous_node_address = ctx.ancestry().current_address();
|
||||
for node_kind in ctx.ancestry().ancestor_kinds() {
|
||||
match node_kind {
|
||||
|
||||
Reference in new issue
Block a user