mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
refactor: 拆分绑定函数与封装宏以简化模块实现
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use oxide_kernel::builtin::FunctionMethods;
|
||||
use oxide_kernel::kernel::OxideKernel;
|
||||
|
||||
pub fn bind_function(kernel: &Arc<OxideKernel>) {
|
||||
let function_methods = FunctionMethods {
|
||||
call: crate::builtins::function::function_call as *const (),
|
||||
apply: crate::builtins::function::function_apply as *const (),
|
||||
bind: crate::builtins::function::function_bind as *const (),
|
||||
};
|
||||
kernel.builtin_world().bind_function_methods(
|
||||
&function_methods,
|
||||
kernel.string_forge().as_ref(),
|
||||
kernel.shape_forge().as_ref(),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user