diff --git a/crates/oxc_semantic/src/binder.rs b/crates/oxc_semantic/src/binder.rs index 029380ab5..82791187a 100644 --- a/crates/oxc_semantic/src/binder.rs +++ b/crates/oxc_semantic/src/binder.rs @@ -122,7 +122,10 @@ impl<'a> Binder for Function<'a> { if (parent_flags.is_strict_mode() || self.r#async || self.generator) && !function_as_var(parent_flags, builder.source_type) { - (SymbolFlags::BlockScopedVariable, SymbolFlags::BlockScopedVariableExcludes) + ( + SymbolFlags::Function | SymbolFlags::BlockScopedVariable, + SymbolFlags::BlockScopedVariableExcludes, + ) } else { ( SymbolFlags::FunctionScopedVariable, diff --git a/crates/oxc_semantic/tests/symbols.rs b/crates/oxc_semantic/tests/symbols.rs index 65f0b7774..c053da081 100644 --- a/crates/oxc_semantic/tests/symbols.rs +++ b/crates/oxc_semantic/tests/symbols.rs @@ -18,7 +18,6 @@ fn test_class_simple() { .test(); } -#[ignore = "function symbols currently lack SymbolFlags::Function"] #[test] fn test_function_simple() { SemanticTester::js("function foo() { return }")