Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions crates/oxc_transformer/src/common/arrow_function_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<'a> Traverse<'a> for ArrowFunctionConverter<'a> {

if let Some(this_var) = self.this_var_stack.take_last() {
let target_scope_id = program.scope_id();
self.insert_this_var_statement_at_the_top_of_statements(
Self::insert_this_var_statement_at_the_top_of_statements(
&mut program.body,
target_scope_id,
&this_var,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl<'a> Traverse<'a> for ArrowFunctionConverter<'a> {
let target_scope_id = func.scope_id();
let Some(body) = &mut func.body else { unreachable!() };

self.insert_this_var_statement_at_the_top_of_statements(
Self::insert_this_var_statement_at_the_top_of_statements(
&mut body.statements,
target_scope_id,
&this_var,
Expand All @@ -208,7 +208,7 @@ impl<'a> Traverse<'a> for ArrowFunctionConverter<'a> {

if let Some(this_var) = self.this_var_stack.pop() {
let target_scope_id = block.scope_id();
self.insert_this_var_statement_at_the_top_of_statements(
Self::insert_this_var_statement_at_the_top_of_statements(
&mut block.body,
target_scope_id,
&this_var,
Expand Down Expand Up @@ -277,7 +277,7 @@ impl<'a> Traverse<'a> for ArrowFunctionConverter<'a> {
unreachable!()
};

*expr = self.transform_arrow_function_expression(arrow_function_expr.unbox(), ctx);
*expr = Self::transform_arrow_function_expression(arrow_function_expr.unbox(), ctx);
}
}
}
Expand Down Expand Up @@ -413,9 +413,7 @@ impl<'a> ArrowFunctionConverter<'a> {
unreachable!();
}

#[expect(clippy::unused_self)]
fn transform_arrow_function_expression(
&mut self,
arrow_function_expr: ArrowFunctionExpression<'a>,
ctx: &mut TraverseCtx<'a>,
) -> Expression<'a> {
Expand Down Expand Up @@ -451,9 +449,7 @@ impl<'a> ArrowFunctionConverter<'a> {
}

/// Insert `var _this = this;` at the top of the statements.
#[expect(clippy::unused_self)]
fn insert_this_var_statement_at_the_top_of_statements(
&mut self,
statements: &mut ArenaVec<'a, Statement<'a>>,
target_scope_id: ScopeId,
this_var: &BoundIdentifier<'a>,
Expand Down