refactor(semantic): improve declare symbol logic in FormalParameters (#2088)

This commit is contained in:
Dunqing 2024-01-20 20:59:11 +08:00 committed by GitHub
parent a36813405b
commit 8e43eeffe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -207,14 +207,14 @@ impl<'a> Binder for FormalParameters<'a> {
SymbolFlags::FunctionScopedVariableExcludes SymbolFlags::FunctionScopedVariableExcludes
}; };
let is_signature = self.kind == FormalParameterKind::Signature; let is_signature = self.kind == FormalParameterKind::Signature;
self.bound_names(&mut |ident| {
if !is_signature { if !is_signature {
self.bound_names(&mut |ident| {
let symbol_id = builder.declare_symbol(ident.span, &ident.name, includes, excludes); let symbol_id = builder.declare_symbol(ident.span, &ident.name, includes, excludes);
ident.symbol_id.set(Some(symbol_id)); ident.symbol_id.set(Some(symbol_id));
}
}); });
} }
} }
}
impl<'a> Binder for CatchClause<'a> { impl<'a> Binder for CatchClause<'a> {
fn bind(&self, builder: &mut SemanticBuilder) { fn bind(&self, builder: &mut SemanticBuilder) {