fix: 逐个按顺序处理 field 与 block 以符合 JS 类元素源码顺序语义

This commit is contained in:
爱特每羊队
2026-08-05 15:04:44 +08:00
parent 211cbe2f5d
commit 0d16d509b2
4 changed files with 26 additions and 36 deletions
+1 -2
View File
@@ -156,8 +156,7 @@ impl Compiler {
self.emit_class_prototype(ctor_reg, proto_reg, super_reg, ctx.sub_modules.len() as u32, ctx)?;
self.emit_class_methods(&class.body.body, ctor_reg, proto_reg, &self_binding, ctx)?;
self.emit_class_static_fields(&class.body.body, ctor_reg, ctx)?;
self.emit_class_static_blocks(&class.body.body, ctor_reg, ctx)?;
self.emit_class_static_elements(&class.body.body, ctor_reg, ctx)?;
ctx.scopes.private_name_map = saved_private_names;
Ok(ctor_reg)