From 65540c01182d643e49f555299c9a5d85a1406bad Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Tue, 14 May 2024 14:33:59 +0100 Subject: [PATCH] fix(traverse): set `ScopeFlags::Function` bit for class methods (#3277) --- crates/oxc_ast/src/ast/js.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 6a4f7809b..9bf838d0c 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -2588,10 +2588,10 @@ impl MethodDefinitionKind { pub fn scope_flags(self) -> ScopeFlags { match self { - Self::Constructor => ScopeFlags::Constructor, - Self::Method => ScopeFlags::empty(), - Self::Get => ScopeFlags::GetAccessor, - Self::Set => ScopeFlags::SetAccessor, + Self::Constructor => ScopeFlags::Constructor | ScopeFlags::Function, + Self::Method => ScopeFlags::Function, + Self::Get => ScopeFlags::GetAccessor | ScopeFlags::Function, + Self::Set => ScopeFlags::SetAccessor | ScopeFlags::Function, } } }