fix: 修复数组回调与原始值属性访问

This commit is contained in:
爱特每羊队
2026-06-17 12:59:11 +08:00
parent 9db28b22d6
commit 5d168316ad
10 changed files with 328 additions and 66 deletions
+5
View File
@@ -109,6 +109,7 @@ pub struct ErrorMethods {
}
pub struct StringMethods {
pub from_char_code: *const (),
pub index_of: *const (),
pub includes: *const (),
pub char_at: *const (),
@@ -938,6 +939,10 @@ impl BuiltinWorld {
}
pub fn bind_string_methods(&self, methods: &StringMethods, string_forge: &StringForge, shape_forge: &ShapeForge) {
let ctor_ptr = P::as_ptr(&self.string_constructor) as *mut JsObject;
let ctor = unsafe { &mut *ctor_ptr };
bind_methods!(self, ctor, string_forge, shape_forge, ("fromCharCode", methods.from_char_code, 1),);
let proto_ptr = P::as_ptr(&self.string_proto) as *mut JsObject;
let proto = unsafe { &mut *proto_ptr };
bind_methods!(