mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: 绑定 Function 和 Object prototype harness helper
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user