Skip to content

Commit

Permalink
refactor(semantic): remove duplicated code (#7276)
Browse files Browse the repository at this point in the history
`if matches!(self.kind, TSModuleDeclarationKind::Global)` at top of function already performed this check, no need to check it again.
  • Loading branch information
overlookmotel committed Nov 14, 2024
1 parent 755a31b commit 9e85cc1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/oxc_semantic/src/binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,8 @@ impl<'a> Binder<'a> for TSModuleDeclaration<'a> {
SymbolFlags::None,
);

// do not bind `global` for `declare global { ... }`
if !self.kind.is_global() {
if let TSModuleDeclarationName::Identifier(id) = &self.id {
id.symbol_id.set(Some(symbol_id));
}
if let TSModuleDeclarationName::Identifier(id) = &self.id {
id.symbol_id.set(Some(symbol_id));
}
}
}
Expand Down

0 comments on commit 9e85cc1

Please sign in to comment.