feat: TA toStringTag 访问器收窄并补 ArrayBuffer tag

This commit is contained in:
2026-09-22 17:23:15 +00:00
parent 72f9a063a4
commit 44f6f6e55b
4 changed files with 60 additions and 5 deletions
@@ -250,7 +250,7 @@ pub fn bind_typed_array(core: &Arc<KernelCore>, session: &KernelSession, global:
session,
shared_proto,
oxide_types::private_key::make_well_known_symbol_key(oxide_types::private_key::WELL_KNOWN_SYMBOL_TO_STRING_TAG),
"get @@toStringTag",
"get [Symbol.toStringTag]",
oxide_builtins::typed_array::typed_array_to_string_tag_getter::<crate::vm::Vm> as *const (),
);
+2 -1
View File
@@ -628,8 +628,9 @@ fn install_to_string_tags(core: &Arc<KernelCore>, session: &KernelSession) {
let sh = core.shape_forge().as_ref();
let tag_id = oxide_types::private_key::WELL_KNOWN_SYMBOL_TO_STRING_TAG;
let tag_key = oxide_types::private_key::make_well_known_symbol_key(tag_id);
let cases: [(*mut JsObject, &str); 11] = [
let cases: [(*mut JsObject, &str); 12] = [
(world.map_proto.as_ptr() as *mut JsObject, "Map"),
(world.array_buffer_proto.as_ptr() as *mut JsObject, "ArrayBuffer"),
(world.set_proto.as_ptr() as *mut JsObject, "Set"),
(world.data_view_proto.as_ptr() as *mut JsObject, "DataView"),
(world.array_iterator_proto.as_ptr() as *mut JsObject, "Array Iterator"),