diff --git a/crates/oxc_transformer/src/common/arrow_function_converter.rs b/crates/oxc_transformer/src/common/arrow_function_converter.rs index c5a45f2fe4294..dbb57506c6027 100644 --- a/crates/oxc_transformer/src/common/arrow_function_converter.rs +++ b/crates/oxc_transformer/src/common/arrow_function_converter.rs @@ -1128,21 +1128,6 @@ impl<'a, 'v> ConstructorBodyThisAfterSuperInserter<'a, 'v> { fn new(this_var_binding: &'v BoundIdentifier<'a>, ctx: &'v mut TraverseCtx<'a>) -> Self { Self { this_var_binding, ctx } } - - #[inline] - fn transform_super_call_expression(&mut self, expr: &Expression<'a>) -> Option> { - if expr.is_super_call_expression() { - let assignment = self.ctx.ast.expression_assignment( - SPAN, - AssignmentOperator::Assign, - self.this_var_binding.create_write_target(self.ctx), - self.ctx.ast.expression_this(SPAN), - ); - Some(assignment) - } else { - None - } - } } impl<'a> VisitMut<'a> for ConstructorBodyThisAfterSuperInserter<'a, '_> { @@ -1188,3 +1173,20 @@ impl<'a> VisitMut<'a> for ConstructorBodyThisAfterSuperInserter<'a, '_> { } } } + +impl<'a> ConstructorBodyThisAfterSuperInserter<'a, '_> { + #[inline] + fn transform_super_call_expression(&mut self, expr: &Expression<'a>) -> Option> { + if expr.is_super_call_expression() { + let assignment = self.ctx.ast.expression_assignment( + SPAN, + AssignmentOperator::Assign, + self.this_var_binding.create_write_target(self.ctx), + self.ctx.ast.expression_this(SPAN), + ); + Some(assignment) + } else { + None + } + } +}