Skip to content

Commit

Permalink
fix(transformer): remove an ast.copy from `NullishCoalescingOperato…
Browse files Browse the repository at this point in the history
…r` transform (#4913)

Remove one unnecessary `ast.copy` call from `NullishCoalescingOperator` transform (towards #3483).
  • Loading branch information
overlookmotel committed Aug 15, 2024
1 parent 72a37fc commit 2476dce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<'a> NullishCoalescingOperator<'a> {

let op = BinaryOperator::StrictInequality;
let null = ctx.ast.expression_null_literal(SPAN);
let left = ctx.ast.expression_binary(SPAN, ctx.ast.copy(&assignment), op, null);
let left = ctx.ast.expression_binary(SPAN, assignment, op, null);
let right = ctx.ast.expression_binary(SPAN, ctx.ast.copy(&reference), op, ctx.ast.void_0());
let test = ctx.ast.expression_logical(SPAN, left, LogicalOperator::And, right);

Expand Down

0 comments on commit 2476dce

Please sign in to comment.