docs: 补充注释与格式化

This commit is contained in:
爱特每羊队
2026-08-06 23:10:27 +08:00
parent 4e0fd762c2
commit 328b8a3ddc
156 changed files with 2393 additions and 1687 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ fn bind_error_subtype_constructor(
let mut ctor = Box::new(JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::from_js_object(function_proto_ptr)));
ctor.set_function(true);
// SAFETY: ctor_fn is a NativeFn fn-item pointer cast to *const () by callers.
// SAFETY: ctor_fn 是调用方转成 *const () 的 NativeFn 函数项指针。
ctor.set_native_fn(Some(unsafe { NativeFnPtr::from_raw(ctor_fn) }));
ctor.set_native_arg_count(1);
@@ -121,7 +121,7 @@ pub fn bind_error(core: &Arc<KernelCore>, session: &KernelSession, global: &mut
{
let err_ctor_ptr = session.builtin_world().error_constructor.as_ptr() as *mut JsObject;
let err_ctor = unsafe { &mut *err_ctor_ptr };
// SAFETY: error_constructor is a NativeFn fn-item.
// SAFETY: error_constructor 是 NativeFn 函数项。
err_ctor.set_native_fn(Some(unsafe {
NativeFnPtr::from_raw(oxide_builtins::error::error_constructor::<crate::vm::Vm> as *const ())
}));