feat(semantic): add SymbolFlags::Function for FunctionDeclaration (#1713)

Co-authored-by: Boshen <boshenc@gmail.com>
This commit is contained in:
Dunqing 2023-12-18 11:26:33 +08:00 committed by GitHub
parent ef08892027
commit edc6fa4830
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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,

View file

@ -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 }")