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(_) => {
// 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;
continue;
}
@ -371,7 +371,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
false
}
ClassElement::StaticBlock(block) => {
if self.static_block {
if self.transform_static_blocks {
self.convert_static_block(block, ctx);
false
} else {

View file

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