Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(transformer/class-properties): remove pointless method #7592

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
23 changes: 0 additions & 23 deletions crates/oxc_transformer/src/es2022/class_properties/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,29 +177,6 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
return;
}

self.transform_class_declaration_impl(class, stmt_address, ctx);
}

/// Transform `export default class {}`.
///
/// Separate function as this is only circumstance where have to deal with anonymous class declaration,
/// and it's an uncommon case (can only be 1 per file).
// TODO: This method is now defunct. Can just have 1 `transform_class_declaration` function.
pub(super) fn transform_class_export_default(
&mut self,
class: &mut Class<'a>,
stmt_address: Address,
ctx: &mut TraverseCtx<'a>,
) {
self.transform_class_declaration_impl(class, stmt_address, ctx);
}

fn transform_class_declaration_impl(
&mut self,
class: &mut Class<'a>,
stmt_address: Address,
ctx: &mut TraverseCtx<'a>,
) {
self.is_declaration = true;

self.transform_class(class, ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl<'a, 'ctx> Traverse<'a> for ClassProperties<'a, 'ctx> {
let stmt_address = decl.address();
if let ExportDefaultDeclarationKind::ClassDeclaration(class) = &mut decl.declaration
{
self.transform_class_export_default(class, stmt_address, ctx);
self.transform_class_declaration(class, stmt_address, ctx);
}
}
_ => {}
Expand Down
Loading