feat: 解构模式语义补齐(REST 枚举/getter/computed 排除、IteratorClose、RegAlloc def 干涉、for-in 捕获遮蔽)

This commit is contained in:
2026-08-09 15:01:31 +08:00
parent c65f3be179
commit 36fb61fc74
12 changed files with 294 additions and 61 deletions
+5
View File
@@ -58,6 +58,11 @@ impl Vm {
if val.is_object() {
return Ok(());
}
if val.is_null() || val.is_undefined() {
// 抛 JS 异常而非返回 Err:外围 try/catch 须能捕获(对象解构空 pattern)。
self.raise_error_kind("TypeError", "Cannot convert null or undefined to object")?;
return Ok(());
}
let obj_val = oxide_runtime_api::to_object(val, self)?;
self.regs[rd] = obj_val;
Ok(())