mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(semantic): delete the redundant code in binder (#2423)
This commit is contained in:
parent
0b9e122de8
commit
7c2d868dc7
1 changed files with 2 additions and 6 deletions
|
|
@ -43,11 +43,10 @@ impl<'a> Binder for VariableDeclarator<'a> {
|
|||
let mut var_scope_ids = vec![];
|
||||
if !builder.current_scope_flags().is_var() {
|
||||
for scope_id in builder.scope.ancestors(current_scope_id).skip(1) {
|
||||
var_scope_ids.push(scope_id);
|
||||
if builder.scope.get_flags(scope_id).is_var() {
|
||||
var_scope_ids.push(scope_id);
|
||||
break;
|
||||
}
|
||||
var_scope_ids.push(scope_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -60,10 +59,7 @@ impl<'a> Binder for VariableDeclarator<'a> {
|
|||
builder.check_redeclaration(*scope_id, span, name, excludes, true)
|
||||
{
|
||||
ident.symbol_id.set(Some(symbol_id));
|
||||
if self.kind.is_var() {
|
||||
builder
|
||||
.add_redeclared_variables(VariableInfo { span: ident.span, symbol_id });
|
||||
}
|
||||
builder.add_redeclared_variables(VariableInfo { span: ident.span, symbol_id });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue