diff --git a/crates/oxc_transformer/src/es2022/class_properties/class.rs b/crates/oxc_transformer/src/es2022/class_properties/class.rs index 3cbca5bce5c96d..8cacb9bdfd3a76 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/class.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/class.rs @@ -486,7 +486,6 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { class, instance_inits, &instance_inits_insert_location, - self.instance_inits_scope_id, constructor_index, ctx, ); diff --git a/crates/oxc_transformer/src/es2022/class_properties/constructor.rs b/crates/oxc_transformer/src/es2022/class_properties/constructor.rs index aac84b1917ddb5..a3c8d19ca8ad3b 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/constructor.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/constructor.rs @@ -208,14 +208,11 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { } /// Insert instance property initializers. - /// - /// `scope_id` has different meaning depending on type of `insertion_location`. pub(super) fn insert_instance_inits( &mut self, class: &mut Class<'a>, inits: Vec>, insertion_location: &InstanceInitsInsertLocation<'a>, - scope_id: ScopeId, constructor_index: usize, ctx: &mut TraverseCtx<'a>, ) { @@ -225,7 +222,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { match insertion_location { InstanceInitsInsertLocation::NewConstructor => { - Self::insert_constructor(class, scope_id, inits, ctx); + Self::insert_constructor(class, self.instance_inits_scope_id, inits, ctx); } InstanceInitsInsertLocation::ExistingConstructor(stmt_index) => { self.insert_inits_into_constructor_as_statements( @@ -241,13 +238,18 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { class, inits, super_binding, - scope_id, + self.instance_inits_scope_id, constructor_index, ctx, ); } InstanceInitsInsertLocation::SuperFnOutsideClass(super_binding) => { - self.create_super_function_outside_constructor(inits, super_binding, scope_id, ctx); + self.create_super_function_outside_constructor( + inits, + super_binding, + self.instance_inits_scope_id, + ctx, + ); } } }