fix: 对齐 Number 原型四方法规范序位并补齐绑定元数据面

This commit is contained in:
2026-09-22 09:59:53 +00:00
parent 4016cfbf9b
commit 550d8f4cba
5 changed files with 367 additions and 67 deletions
+7 -3
View File
@@ -7,8 +7,8 @@ use oxide_types::object::JsObject;
use oxide_types::value::JsValue;
use super::construct::{
builtin_labels, make_error_subtypes, make_named_pair, make_typed_array_family, wire_builtin_world_links,
ErrorSubtypeProtos, TypedArrayFamily,
builtin_labels, make_error_subtypes, make_named_pair, make_typed_array_family, tag_number_proto,
wire_builtin_world_links, ErrorSubtypeProtos, TypedArrayFamily,
};
use super::BuiltinWorld;
use crate::kernel::BuiltinDirtySet;
@@ -183,7 +183,11 @@ impl BuiltinWorld {
(current.string_proto.clone(), current.string_constructor.clone())
};
let (number_proto, number_constructor) = if dirty.number {
make_named_pair(string_forge, shape_forge, labels, "Number")
// 脏重建与全量构造同形:原型本体须带 Number 对象 tag 与 +0 包值,
// 漏此分支 full_reset 后 tag 翻回 "Object"。
let (proto, ctor) = make_named_pair(string_forge, shape_forge, labels, "Number");
tag_number_proto(&proto);
(proto, ctor)
} else {
(current.number_proto.clone(), current.number_constructor.clone())
};