refactor(compiler): remove class count helpers

This commit is contained in:
爱特每羊队
2026-08-05 01:41:51 +08:00
parent fd4172203e
commit 0f78f341fa
12 changed files with 2 additions and 323 deletions
+2 -28
View File
@@ -66,20 +66,7 @@ impl Compiler {
false,
&self_binding,
FunctionBodyContext::ClassElement,
Some(|compiler: &Compiler, field_ctx: &mut CompileCtx| {
for field in &instance_fields {
if matches!(field.key, PropertyKey::PrivateIdentifier(_)) {
compiler.count_private_field_init(field.value.as_ref(), field_ctx);
} else {
compiler.count_public_field_init(
&field.key,
field.computed,
field.value.as_ref(),
field_ctx,
);
}
}
}),
None::<fn(&Compiler, &mut CompileCtx)>,
Some(|compiler: &Compiler, field_ctx: &mut CompileCtx| -> Result<(), String> {
for field in &instance_fields {
if let PropertyKey::PrivateIdentifier(private) = &field.key {
@@ -111,20 +98,7 @@ impl Compiler {
false,
&self_binding,
FunctionBodyContext::ClassElement,
Some(|compiler: &Compiler, field_ctx: &mut CompileCtx| {
for field in &instance_fields {
if matches!(field.key, PropertyKey::PrivateIdentifier(_)) {
compiler.count_private_field_init(field.value.as_ref(), field_ctx);
} else {
compiler.count_public_field_init(
&field.key,
field.computed,
field.value.as_ref(),
field_ctx,
);
}
}
}),
None::<fn(&Compiler, &mut CompileCtx)>,
Some(|compiler: &Compiler, field_ctx: &mut CompileCtx| -> Result<(), String> {
for field in &instance_fields {
if let PropertyKey::PrivateIdentifier(private) = &field.key {