Skip to content

Commit

Permalink
perf(semantic): simplify resetting ReferenceFlags in `AssignmentExpre…
Browse files Browse the repository at this point in the history
…ssion` (#5846)
  • Loading branch information
Dunqing committed Sep 21, 2024
1 parent 1574334 commit c3e0fb6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2003,14 +2003,7 @@ impl<'a> SemanticBuilder<'a> {
}
self.current_reference_flags -= ReferenceFlags::Write;
}
AstKind::AssignmentExpression(expr) => {
if expr.operator != AssignmentOperator::Assign
|| self.is_not_expression_statement_parent()
{
self.current_reference_flags -= ReferenceFlags::Read;
}
}
AstKind::ExportNamedDeclaration(_)
AstKind::AssignmentExpression(_) | AstKind::ExportNamedDeclaration(_)
| AstKind::TSTypeQuery(_)
// Clear the reference flags that are set in AstKind::PropertySignature
| AstKind::PropertyKey(_) => {
Expand Down

0 comments on commit c3e0fb6

Please sign in to comment.