mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
feat: ArrayBuffer 载荷状态位与 byteLength 原型访问器
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::bind_constructor;
|
||||
use crate::bindings::{apply_binding_table, bind_accessor_getter_key, configure_native_constructor};
|
||||
use crate::bindings::{
|
||||
apply_binding_table, bind_accessor_getter, bind_accessor_getter_key, configure_native_constructor,
|
||||
};
|
||||
use oxide_kernel::kernel::{KernelCore, KernelSession};
|
||||
use oxide_types::object::JsObject;
|
||||
|
||||
@@ -45,11 +47,6 @@ pub fn bind_array_buffer(core: &Arc<KernelCore>, session: &KernelSession, global
|
||||
proto,
|
||||
core,
|
||||
&[
|
||||
(
|
||||
"byteLength",
|
||||
oxide_builtins::array_buffer::array_buffer_byte_length::<crate::vm::Vm> as *const (),
|
||||
0,
|
||||
),
|
||||
("slice", oxide_builtins::array_buffer::array_buffer_slice::<crate::vm::Vm> as *const (), 2),
|
||||
(
|
||||
"toString",
|
||||
@@ -59,6 +56,15 @@ pub fn bind_array_buffer(core: &Arc<KernelCore>, session: &KernelSession, global
|
||||
],
|
||||
);
|
||||
|
||||
// byteLength 原型访问器(set 恒 undefined):读载荷字节数,实例无 own 属性。
|
||||
bind_accessor_getter(
|
||||
core,
|
||||
session,
|
||||
proto,
|
||||
"byteLength",
|
||||
oxide_builtins::array_buffer::array_buffer_byte_length::<crate::vm::Vm> as *const (),
|
||||
);
|
||||
|
||||
bind_constructor!(
|
||||
core,
|
||||
global,
|
||||
|
||||
Reference in New Issue
Block a user