Skip to content

Commit

Permalink
refactor(semantic)!: Reference::flag method return ReferenceFlag (#…
Browse files Browse the repository at this point in the history
…5019)

Closes #4992.
  • Loading branch information
overlookmotel committed Aug 20, 2024
1 parent 2292606 commit c30e2e9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ impl<'a> SemanticBuilder<'a> {

references.retain(|&reference_id| {
let reference = &mut self.symbols.references[reference_id];
let flag = *reference.flag();
let flag = reference.flag();
if flag.is_type() && symbol_flag.can_be_referenced_by_type()
|| flag.is_value() && symbol_flag.can_be_referenced_by_value()
|| flag.is_ts_type_query() && symbol_flag.is_import()
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_semantic/src/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ impl Reference {
}

#[inline]
pub fn flag(&self) -> &ReferenceFlag {
&self.flag
pub fn flag(&self) -> ReferenceFlag {
self.flag
}

#[inline]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<'a> ExponentiationOperator<'a> {
let reference = ctx.symbols().get_reference(ident.reference_id.get().unwrap());
let symbol_id = reference.symbol_id();
let flag = reference.flag();
ctx.create_reference_id(ident.span, ident.name.clone(), symbol_id, *flag)
ctx.create_reference_id(ident.span, ident.name.clone(), symbol_id, flag)
}

fn clone_expression(expr: &Expression<'a>, ctx: &mut TraverseCtx<'a>) -> Expression<'a> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl<'a> LogicalAssignmentOperators<'a> {
let reference = ctx.symbols().get_reference(ident.reference_id.get().unwrap());
let symbol_id = reference.symbol_id();
let flag = reference.flag();
ctx.create_reference_id(ident.span, ident.name.clone(), symbol_id, *flag)
ctx.create_reference_id(ident.span, ident.name.clone(), symbol_id, flag)
}

pub fn maybe_generate_memoised(
Expand Down

0 comments on commit c30e2e9

Please sign in to comment.