Skip to content

Commit 7c2d868

Browse files
authored
refactor(semantic): delete the redundant code in binder (#2423)
1 parent 0b9e122 commit 7c2d868

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

crates/oxc_semantic/src/binder.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@ impl<'a> Binder for VariableDeclarator<'a> {
4343
let mut var_scope_ids = vec![];
4444
if !builder.current_scope_flags().is_var() {
4545
for scope_id in builder.scope.ancestors(current_scope_id).skip(1) {
46+
var_scope_ids.push(scope_id);
4647
if builder.scope.get_flags(scope_id).is_var() {
47-
var_scope_ids.push(scope_id);
4848
break;
4949
}
50-
var_scope_ids.push(scope_id);
5150
}
5251
}
5352

@@ -60,10 +59,7 @@ impl<'a> Binder for VariableDeclarator<'a> {
6059
builder.check_redeclaration(*scope_id, span, name, excludes, true)
6160
{
6261
ident.symbol_id.set(Some(symbol_id));
63-
if self.kind.is_var() {
64-
builder
65-
.add_redeclared_variables(VariableInfo { span: ident.span, symbol_id });
66-
}
62+
builder.add_redeclared_variables(VariableInfo { span: ident.span, symbol_id });
6763
return;
6864
}
6965
}

0 commit comments

Comments
 (0)