diff --git a/crates/oxc_transformer/src/es2022/class_properties/private.rs b/crates/oxc_transformer/src/es2022/class_properties/private.rs index 0dbfae74f62d03..69d1450f6ce285 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/private.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/private.rs @@ -1171,7 +1171,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> { // // TODO(improve-on-babel): Consider remove this logic, because it seems no runtime behavior change. let result = self.transform_chain_element_recursively(callee, ctx)?; - let object = callee.to_member_expression_mut().object_mut(); + let object = callee.as_member_expression_mut()?.object_mut(); let (assignment, context) = self.duplicate_object(ctx.ast.move_expression(object), ctx); *object = assignment; let callee = ctx.ast.move_expression(&mut call_expr.callee); diff --git a/crates/oxc_transformer/src/options/env.rs b/crates/oxc_transformer/src/options/env.rs index eee0aa45861156..d720991cc4fe72 100644 --- a/crates/oxc_transformer/src/options/env.rs +++ b/crates/oxc_transformer/src/options/env.rs @@ -84,11 +84,7 @@ impl EnvOptions { es2021: ES2021Options { logical_assignment_operators: true }, es2022: ES2022Options { class_static_block: true, - class_properties: if include_unfinished_plugins { - Some(ClassPropertiesOptions::default()) - } else { - None - }, + class_properties: Some(ClassPropertiesOptions::default()), }, } } @@ -139,9 +135,7 @@ impl EnvOptions { } } engine_targets.insert(Engine::Es, es_target.unwrap_or(ESTarget::default()).version()); - let mut env_options = EnvOptions::from(engine_targets); - env_options.es2022.class_properties = None; - Ok(env_options) + Ok(EnvOptions::from(engine_targets)) } } diff --git a/crates/oxc_transformer/src/options/mod.rs b/crates/oxc_transformer/src/options/mod.rs index aa2963c035d490..ef30e08e3f3fda 100644 --- a/crates/oxc_transformer/src/options/mod.rs +++ b/crates/oxc_transformer/src/options/mod.rs @@ -122,8 +122,7 @@ impl From for TransformOptions { fn from(target: ESTarget) -> Self { let mut engine_targets = EngineTargets::default(); engine_targets.insert(Engine::Es, target.version()); - let mut env = EnvOptions::from(engine_targets); - env.es2022.class_properties = None; + let env = EnvOptions::from(engine_targets); Self { env, ..Self::default() } } }