mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
fix: 私有访问器 brand 槽放行
This commit is contained in:
@@ -92,9 +92,9 @@ impl Vm {
|
|||||||
depth += 1;
|
depth += 1;
|
||||||
let proto_obj = unsafe { &*proto.as_js_object_ptr() };
|
let proto_obj = unsafe { &*proto.as_js_object_ptr() };
|
||||||
if let Some(pos) = self.private_slot(proto_obj, private_key) {
|
if let Some(pos) = self.private_slot(proto_obj, private_key) {
|
||||||
// 方法槽有 hole 标记(set_private_method_meta);字段槽(存实例)沿链出现
|
// 方法/访问器槽有 hole 标记(私有方法)或 is_accessor 标记(私有 getter/setter);
|
||||||
// 说明接收者并非本类实例 → 拒绝穿透。
|
// 字段槽(存实例)沿链出现说明接收者并非本类实例 → 拒绝穿透。
|
||||||
if proto_obj.prop_meta_at(pos).is_some_and(|m| m.is_hole()) {
|
if proto_obj.prop_meta_at(pos).is_some_and(|m| m.is_hole() || m.is_accessor) {
|
||||||
return Some(proto_obj as *const JsObject as *mut JsObject);
|
return Some(proto_obj as *const JsObject as *mut JsObject);
|
||||||
}
|
}
|
||||||
return None;
|
return None;
|
||||||
|
|||||||
Reference in New Issue
Block a user