Skip to content

Commit

Permalink
refactor(transformer/typescript): determine whether to remove `Export…
Browse files Browse the repository at this point in the history
…Speicifer` by `ReferenceFlags` (#4513)

After #4511. We can determine if a binding is a type binding just by the `ReferenceFlags`.

We can make it even better with `ident.reference_flag` once #4512 is sorted out
  • Loading branch information
Dunqing committed Jul 29, 2024
1 parent cf1854b commit 96602bf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/oxc_transformer/src/typescript/annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ impl<'a> TypeScriptAnnotations<'a> {
&specifier.local
{
ident.reference_id.get().is_some_and(|id| {
ctx.symbols().references[id].symbol_id().is_some_and(
|symbol_id| {
!ctx.symbols().get_flag(symbol_id).is_value()
},
)
ctx.symbols().get_reference(id).is_type()
})
} else {
false
Expand Down

0 comments on commit 96602bf

Please sign in to comment.