mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
feat: 解构模式语义补齐(REST 枚举/getter/computed 排除、IteratorClose、RegAlloc def 干涉、for-in 捕获遮蔽)
This commit is contained in:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user