feat: 间接 eval 读全局词法环境镜像并补齐写路径

This commit is contained in:
2026-10-16 15:03:55 +00:00
parent 84900dc4a1
commit cf0b59d892
18 changed files with 250 additions and 31 deletions
+12
View File
@@ -281,6 +281,12 @@ impl Vm {
Err(e) => return Err(e),
},
OpCode::LOAD_GLOBAL_LEX => match self.dispatch_load_global_lex(rd, instr) {
Ok(true) => continue,
Ok(false) => {}
Err(e) => return Err(e),
},
OpCode::LOAD_GLOBAL_TYPEOF => {
self.dispatch_load_global_typeof(rd, instr)?;
}
@@ -581,6 +587,12 @@ impl Vm {
self.dispatch_delete_global_prop_c(rd, a, key_idx)?;
}
OpCode::STORE_GLOBAL_LEX => {
let key_idx = self.bytecode[self.pc] as u16;
self.pc += 1;
self.dispatch_store_global_lex(a, key_idx)?;
}
OpCode::CAN_DECLARE_GLOBAL_FUNC => {
self.dispatch_can_declare_global_func(rd, b)?;
}