feat: 实现 RegExp.escape 静态方法

This commit is contained in:
2026-09-21 01:27:41 +00:00
parent 7062300a37
commit 46211a66a5
3 changed files with 177 additions and 0 deletions
@@ -15,6 +15,14 @@ pub fn bind_regexp(core: &Arc<KernelCore>, session: &KernelSession, global: &mut
configure_native_constructor(ctor, oxide_builtins::regexp::regexp_constructor::<crate::vm::Vm> as *const (), 2);
// 静态方法 escape 装到构造器对象(wrapper 的 length/name 与槽属性由 bind_method 统一保证)。
apply_binding_table(
session.builtin_world(),
ctor,
core,
&[("escape", oxide_builtins::regexp::regexp_escape::<crate::vm::Vm> as *const (), 1)],
);
apply_binding_table(
session.builtin_world(),
proto,