mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
refactor: 表驱动化直接 builtin 绑定模块
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::bind_constructor_hash;
|
||||
use oxide_kernel::bind_method;
|
||||
use oxide_kernel::bind_methods;
|
||||
use oxide_kernel::kernel::OxideKernel;
|
||||
use oxide_types::object::JsObject;
|
||||
|
||||
@@ -16,59 +16,17 @@ pub fn bind_map(kernel: &Arc<OxideKernel>, global: &mut JsObject) {
|
||||
let sf = kernel.string_forge().as_ref();
|
||||
let sh = kernel.shape_forge().as_ref();
|
||||
|
||||
bind_method!(
|
||||
bind_methods!(
|
||||
kernel.builtin_world(),
|
||||
proto,
|
||||
sf,
|
||||
sh,
|
||||
"set",
|
||||
crate::builtins::map::map_set,
|
||||
2
|
||||
);
|
||||
bind_method!(
|
||||
kernel.builtin_world(),
|
||||
proto,
|
||||
sf,
|
||||
sh,
|
||||
"get",
|
||||
crate::builtins::map::map_get,
|
||||
1
|
||||
);
|
||||
bind_method!(
|
||||
kernel.builtin_world(),
|
||||
proto,
|
||||
sf,
|
||||
sh,
|
||||
"has",
|
||||
crate::builtins::map::map_has,
|
||||
1
|
||||
);
|
||||
bind_method!(
|
||||
kernel.builtin_world(),
|
||||
proto,
|
||||
sf,
|
||||
sh,
|
||||
"delete",
|
||||
crate::builtins::map::map_delete,
|
||||
1
|
||||
);
|
||||
bind_method!(
|
||||
kernel.builtin_world(),
|
||||
proto,
|
||||
sf,
|
||||
sh,
|
||||
"clear",
|
||||
crate::builtins::map::map_clear,
|
||||
0
|
||||
);
|
||||
bind_method!(
|
||||
kernel.builtin_world(),
|
||||
proto,
|
||||
sf,
|
||||
sh,
|
||||
"size",
|
||||
crate::builtins::map::map_size,
|
||||
0
|
||||
("set", crate::builtins::map::map_set, 2),
|
||||
("get", crate::builtins::map::map_get, 1),
|
||||
("has", crate::builtins::map::map_has, 1),
|
||||
("delete", crate::builtins::map::map_delete, 1),
|
||||
("clear", crate::builtins::map::map_clear, 0),
|
||||
("size", crate::builtins::map::map_size, 0),
|
||||
);
|
||||
|
||||
bind_constructor_hash!(
|
||||
|
||||
Reference in New Issue
Block a user