Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/es2022/class_properties/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions crates/oxc_transformer/src/es2022/class_properties/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,

Expand Down Expand Up @@ -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
Expand All @@ -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),
Expand Down