fix: 修复对 Object.prototype 非 null 赋值问题

This commit is contained in:
爱特每羊队
2026-06-09 21:18:16 +08:00
parent 0a93cc4fef
commit 3787bc336e
2 changed files with 18 additions and 0 deletions
+5
View File
@@ -198,6 +198,11 @@ impl Vm {
&self.kernel
}
pub(crate) fn is_object_prototype(&self, ptr: *const JsObject) -> bool {
let proto_ptr = self.kernel.builtin_world().object_proto.as_ptr();
std::ptr::eq(ptr, proto_ptr)
}
pub fn reg(&self, idx: u8) -> JsValue {
self.regs[idx as usize]
}