Skip to content

Commit

Permalink
refactor(transformer/class-properties): rename *_owner to owned_* (
Browse files Browse the repository at this point in the history
…#7855)

If I understand #7831 correctly, `owned_*` are better here
  • Loading branch information
Dunqing committed Dec 13, 2024
1 parent 4b24335 commit 0f5e078
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/oxc_transformer/src/es2022/class_properties/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,8 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
// `o?.Foo.#self.self?.self.unicorn;` -> `(result ? void 0 : object)?.self.unicorn`
// ^^^^^^^^^^^^^^^^^ the object has transformed, if the current member is optional,
// then we need to wrap it to a conditional expression
let object_owner = ctx.ast.move_expression(object);
*object = Self::wrap_conditional_check(result, object_owner, ctx);
let owned_object = ctx.ast.move_expression(object);
*object = Self::wrap_conditional_check(result, owned_object, ctx);
None
} else {
Some(result)
Expand Down Expand Up @@ -1359,8 +1359,8 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {

// After the below transformation, the `callee` will be a temp variable.
let result = self.transform_expression_to_wrap_nullish_check(callee, ctx);
let callee_owner = ctx.ast.move_expression(callee);
Self::substitute_callee_and_insert_context(call, callee_owner, context, ctx);
let owned_callee = ctx.ast.move_expression(callee);
Self::substitute_callee_and_insert_context(call, owned_callee, context, ctx);
result
}

Expand Down

0 comments on commit 0f5e078

Please sign in to comment.