refactor(transformer/class-properties): rename var (#7477)

Pure refactor. Name var more descriptively.
This commit is contained in:
overlookmotel 2024-11-25 16:45:21 +00:00
parent 17fb7e5303
commit abb0e0e08e
2 changed files with 5 additions and 5 deletions

View file

@ -319,7 +319,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
} }
ClassElement::StaticBlock(_) => { ClassElement::StaticBlock(_) => {
// Static block only necessitates transforming class if it's being transformed // Static block only necessitates transforming class if it's being transformed
if self.static_block { if self.transform_static_blocks {
has_static_prop_or_static_block = true; has_static_prop_or_static_block = true;
continue; continue;
} }
@ -371,7 +371,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
false false
} }
ClassElement::StaticBlock(block) => { ClassElement::StaticBlock(block) => {
if self.static_block { if self.transform_static_blocks {
self.convert_static_block(block, ctx); self.convert_static_block(block, ctx);
false false
} else { } else {

View file

@ -136,7 +136,7 @@ pub struct ClassPropertiesOptions {
pub struct ClassProperties<'a, 'ctx> { pub struct ClassProperties<'a, 'ctx> {
// Options // Options
set_public_class_fields: bool, set_public_class_fields: bool,
static_block: bool, transform_static_blocks: bool,
ctx: &'ctx TransformCtx<'a>, ctx: &'ctx TransformCtx<'a>,
@ -200,7 +200,7 @@ struct PrivateProp<'a> {
impl<'a, 'ctx> ClassProperties<'a, 'ctx> { impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
pub fn new( pub fn new(
options: ClassPropertiesOptions, options: ClassPropertiesOptions,
static_block: bool, transform_static_blocks: bool,
ctx: &'ctx TransformCtx<'a>, ctx: &'ctx TransformCtx<'a>,
) -> Self { ) -> Self {
// TODO: Raise error if these 2 options are inconsistent // TODO: Raise error if these 2 options are inconsistent
@ -209,7 +209,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
Self { Self {
set_public_class_fields, set_public_class_fields,
static_block, transform_static_blocks,
ctx, ctx,
private_props_stack: SparseStack::new(), private_props_stack: SparseStack::new(),
class_expression_addresses_stack: NonEmptyStack::new(Address::DUMMY), class_expression_addresses_stack: NonEmptyStack::new(Address::DUMMY),