feat: 七构造器绑定 Symbol.species 静态访问器

This commit is contained in:
2026-09-22 16:55:07 +00:00
parent 2252ed7bbc
commit 72f9a063a4
9 changed files with 176 additions and 8 deletions
@@ -1,7 +1,7 @@
use std::sync::Arc;
use crate::bind_constructor;
use crate::bindings::{apply_binding_table, configure_native_constructor};
use crate::bindings::{apply_binding_table, bind_accessor_getter_key, configure_native_constructor};
use oxide_kernel::kernel::{KernelCore, KernelSession};
use oxide_types::object::JsObject;
@@ -29,6 +29,17 @@ pub fn bind_array_buffer(core: &Arc<KernelCore>, session: &KernelSession, global
)],
);
// ArrayBuffer[Symbol.species] 访问器:getter 返回 receiver,派生类沿静态原型链
// 解析 @@species 得自身构造器(规范不给 class 默认 static @@species,类上无 own)。
bind_accessor_getter_key(
core,
session,
ctor,
oxide_types::private_key::make_well_known_symbol_key(oxide_types::private_key::WELL_KNOWN_SYMBOL_SPECIES),
"get [Symbol.species]",
oxide_builtins::array::array_species_get::<crate::vm::Vm> as *const (),
);
apply_binding_table(
session.builtin_world(),
proto,