Skip to content

Commit

Permalink
refactor(transformer/typescript): shorten code (#8504)
Browse files Browse the repository at this point in the history
Pure refactor. Just shorten code by using `BoundIdentifier::create_write_target`, which returns an `AssignmentTarget`.
  • Loading branch information
overlookmotel committed Jan 15, 2025
1 parent 356f0c1 commit 7e61b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/typescript/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl<'a> TypeScriptNamespace<'a, '_> {
))
} else {
// _N
AssignmentTarget::from(binding.create_write_simple_target(ctx))
binding.create_write_target(ctx)
};

let assign_right = ctx.ast.expression_object(SPAN, ctx.ast.vec(), None);
Expand All @@ -345,7 +345,7 @@ impl<'a> TypeScriptNamespace<'a, '_> {

// (M = _N.M || (_N.M = {}))
if let Some(parent_binding) = parent_binding {
let assign_left = AssignmentTarget::from(binding.create_write_simple_target(ctx));
let assign_left = binding.create_write_target(ctx);
let assign_right = {
let property = ctx.ast.identifier_name(SPAN, binding.name.clone());
let logical_left = ctx.ast.member_expression_static(
Expand Down

0 comments on commit 7e61b23

Please sign in to comment.