Skip to content

Commit

Permalink
Rename var + move statements
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 5, 2024
1 parent 40762e3 commit f787b71
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/oxc_transformer/src/es2022/class_properties/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,11 +1112,10 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
object: &mut Expression<'a>,
ctx: &mut TraverseCtx<'a>,
) -> Expression<'a> {
let object_owner = ctx.ast.move_expression(object.get_inner_expression_mut());
let (assignment, reference) = self.duplicate_object(
Self::ensure_optional_expression_wrapped_by_chain_expression(object_owner, ctx),
ctx,
);
let owned_object = ctx.ast.move_expression(object.get_inner_expression_mut());
let owned_object =
Self::ensure_optional_expression_wrapped_by_chain_expression(owned_object, ctx);
let (assignment, reference) = self.duplicate_object(owned_object, ctx);
// We cannot use `clone_in` to clone identifier reference because it will lose reference id
*object = if let Expression::Identifier(ident) = &reference {
MaybeBoundIdentifier::from_identifier_reference(ident, ctx).create_read_expression(ctx)
Expand Down

0 comments on commit f787b71

Please sign in to comment.