From 57e9dcf0465b0195b0d38da9b1bcbb1c91611efb Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 8 Jan 2025 01:32:55 +0000 Subject: [PATCH] refactor(transformer/arrow-functions): shorten `AstBuilder` call (#8317) Follow-on after #8024. Pure refactor, just shorten code. --- crates/oxc_transformer/src/common/arrow_function_converter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_transformer/src/common/arrow_function_converter.rs b/crates/oxc_transformer/src/common/arrow_function_converter.rs index 42e2ab784c8e9..30a32a712378e 100644 --- a/crates/oxc_transformer/src/common/arrow_function_converter.rs +++ b/crates/oxc_transformer/src/common/arrow_function_converter.rs @@ -1088,7 +1088,7 @@ impl<'a> ArrowFunctionConverter<'a> { .visit_statements(statements); None } else { - Some(Expression::ThisExpression(ctx.ast.alloc_this_expression(SPAN))) + Some(ctx.ast.expression_this(SPAN)) }; Self::adjust_binding_scope(target_scope_id, &this_var, ctx); let variable_declarator = ctx.ast.variable_declarator(