mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
refactor: 绑定层函数签名收敛为 BindEnv 单参
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use oxide_kernel::kernel::{KernelCore, KernelSession};
|
||||
use oxide_types::object::JsObject;
|
||||
|
||||
use crate::bindings::apply_binding_table;
|
||||
use crate::bindings::{apply_binding_table, BindEnv};
|
||||
|
||||
/// 把普通全局函数(`isNaN`、`parseInt`、`decodeURIComponent` 等)绑定到 global。
|
||||
pub fn bind_global(core: &Arc<KernelCore>, session: &KernelSession, global: &mut JsObject) {
|
||||
pub fn bind_global(env: BindEnv<'_>, global: &mut JsObject) {
|
||||
apply_binding_table(
|
||||
session.builtin_world(),
|
||||
env,
|
||||
global,
|
||||
core,
|
||||
&[
|
||||
("escape", oxide_builtins::global::js_escape::<crate::vm::Vm> as *const (), 1),
|
||||
("unescape", oxide_builtins::global::js_unescape::<crate::vm::Vm> as *const (), 1),
|
||||
|
||||
Reference in New Issue
Block a user