refactor(transformer/logic-assignment): shorten code (#7419)

Use `create_spanned_read_expression` instead of `create_spanned_expression`, as it's shorter than specifying `ReferenceFlags` manually.
This commit is contained in:
overlookmotel 2024-11-22 11:42:02 +00:00
parent be5f843a12
commit eb39a50a2e

View file

@ -296,7 +296,7 @@ impl<'a, 'ctx> LogicalAssignmentOperators<'a, 'ctx> {
match expr {
Expression::Identifier(ident) => {
let binding = MaybeBoundIdentifier::from_identifier_reference(ident, ctx);
binding.create_spanned_expression(ident.span, ReferenceFlags::Read, ctx)
binding.create_spanned_read_expression(ident.span, ctx)
}
_ => expr.clone_in(ctx.ast.allocator),
}