mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
fix: class 类名绑定 TDZ 与 const 语义(extends 引用类名抛 ReferenceError,类构建后初始化绑定)
This commit is contained in:
@@ -26,8 +26,9 @@ impl Emitter {
|
||||
reg
|
||||
}
|
||||
};
|
||||
ctx.init_var(&name);
|
||||
let ctor_reg = self.emit_class(class, ctx)?;
|
||||
// 类名绑定在 emit_class_with_binding 内于 extends 求值后初始化:
|
||||
// 先声明未初始化绑定(TDZ),extends 引用类名按规范抛 ReferenceError。
|
||||
let ctor_reg = self.emit_class_with_binding(class, ctx, Some(var_reg))?;
|
||||
if let Some(&cell_idx) = ctx.captured_bindings.get(&name) {
|
||||
ctx.inst(Inst::new(
|
||||
OpCode::MAKE_CELL,
|
||||
|
||||
Reference in New Issue
Block a user