feat: 补全 Object.prototype 方法族与 toString 标签

This commit is contained in:
2026-09-21 03:30:25 +00:00
parent 7481ceb798
commit d93215c83b
8 changed files with 397 additions and 91 deletions
+3 -2
View File
@@ -437,8 +437,9 @@ pub(crate) fn init_async_intrinsics(vm: &mut Vm) {
let cpos = af_proto.push_prop(JsValue::from_js_object(af_ctor_ptr));
af_proto.set_data_meta(cpos, PropAttributes::new(false, false, true));
// af_proto[Symbol.toStringTag] = "AsyncFunction"(数据属性,w/e/c = false/false/true)。
let tag_si = sf.intern("@@toStringTag").0;
let tag_shape = sh.make_shape(af_proto.shape_id(), tag_si);
let tag_key =
oxide_types::private_key::make_well_known_symbol_key(oxide_types::private_key::WELL_KNOWN_SYMBOL_TO_STRING_TAG);
let tag_shape = sh.make_shape(af_proto.shape_id(), tag_key);
af_proto.set_shape_id(tag_shape);
let tag_pos = af_proto.push_prop(JsValue::perm_string(sf.string_ptr(sf.intern("AsyncFunction").0)));
af_proto.set_data_meta(tag_pos, PropAttributes::new(false, false, true));