feat: SAB 原型 slice 完整语义(species 默认 SAB 与结果三检直拷)

This commit is contained in:
2026-09-24 00:16:53 +00:00
parent 8e52a4688e
commit 885c67428d
3 changed files with 309 additions and 20 deletions
@@ -18,16 +18,24 @@ pub fn bind_shared_array_buffer(core: &Arc<KernelCore>, session: &KernelSession,
1,
);
// grow 方法(slice 归后续面):growable 缓冲区原地增长,只增不缩。
// grow/slice 方法:grow 原地增长(只增不缩);slice 复制字节区间生成
// 新 SAB。
apply_binding_table(
session.builtin_world(),
proto,
core,
&[(
"grow",
oxide_builtins::array_buffer::shared_array_buffer_grow::<crate::vm::Vm> as *const (),
1,
)],
&[
(
"grow",
oxide_builtins::array_buffer::shared_array_buffer_grow::<crate::vm::Vm> as *const (),
1,
),
(
"slice",
oxide_builtins::array_buffer::shared_array_buffer_slice::<crate::vm::Vm> as *const (),
2,
),
],
);
// byteLength/maxByteLength 两枚访问器(set 恒 undefined)读载荷字节数 /