mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
feat(semantic): add SymbolFlags::Function for FunctionDeclaration (#1713)
Co-authored-by: Boshen <boshenc@gmail.com>
This commit is contained in:
parent
ef08892027
commit
edc6fa4830
2 changed files with 4 additions and 2 deletions
|
|
@ -122,7 +122,10 @@ impl<'a> Binder for Function<'a> {
|
||||||
if (parent_flags.is_strict_mode() || self.r#async || self.generator)
|
if (parent_flags.is_strict_mode() || self.r#async || self.generator)
|
||||||
&& !function_as_var(parent_flags, builder.source_type)
|
&& !function_as_var(parent_flags, builder.source_type)
|
||||||
{
|
{
|
||||||
(SymbolFlags::BlockScopedVariable, SymbolFlags::BlockScopedVariableExcludes)
|
(
|
||||||
|
SymbolFlags::Function | SymbolFlags::BlockScopedVariable,
|
||||||
|
SymbolFlags::BlockScopedVariableExcludes,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
(
|
(
|
||||||
SymbolFlags::FunctionScopedVariable,
|
SymbolFlags::FunctionScopedVariable,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ fn test_class_simple() {
|
||||||
.test();
|
.test();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[ignore = "function symbols currently lack SymbolFlags::Function"]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_function_simple() {
|
fn test_function_simple() {
|
||||||
SemanticTester::js("function foo() { return }")
|
SemanticTester::js("function foo() { return }")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue