fix: 绑定 Function 和 Object prototype harness helper

This commit is contained in:
2026-06-09 19:31:46 +08:00
parent a6982bdf56
commit 06c313e802
7 changed files with 103 additions and 7 deletions
+13
View File
@@ -58,6 +58,8 @@ pub struct ObjectMethods {
pub has_own: *const (),
pub entries: *const (),
pub values: *const (),
pub has_own_property: *const (),
pub property_is_enumerable: *const (),
}
pub struct ArrayMethods {
@@ -408,6 +410,17 @@ impl BuiltinWorld {
("entries", methods.entries, 1),
("values", methods.values, 1),
);
let proto_ptr = P::as_ptr(&self.object_proto) as *mut JsObject;
let proto = unsafe { &mut *proto_ptr };
bind_methods!(
self,
proto,
string_forge,
shape_forge,
("hasOwnProperty", methods.has_own_property, 1),
("propertyIsEnumerable", methods.property_is_enumerable, 1),
);
}
pub fn bind_array_methods(&self, methods: &ArrayMethods, string_forge: &StringForge, shape_forge: &ShapeForge) {