refactor: 内置十四文件迁移内核访问器调用至能力方法

This commit is contained in:
2026-10-08 07:59:40 +00:00
parent 5970f804d7
commit 47912535d5
16 changed files with 47 additions and 48 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ use num_traits::Zero;
use oxide_types::object::JsObject;
use oxide_types::value::JsValue;
use oxide_runtime_api::{NativeResult, VmHost};
use oxide_runtime_api::{NativeResult, ProtoKind, VmHost};
/// JS `Boolean()` 构造逻辑:把参数按 ToBoolean 语义转换。
/// 以普通函数调用时返回原始 bool;以 new 语义调用时返回 `[[BooleanData]]` 为结果的包装对象。
@@ -38,7 +38,7 @@ pub fn boolean_constructor<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
false
};
let boolean_proto = vm.session().builtin_world().boolean_proto.as_ptr() as *mut JsObject;
let boolean_proto = vm.builtin_proto(ProtoKind::BooleanProto);
let is_ctor = if this_val.is_object() {
let ptr = this_val.as_js_object_ptr();
if ptr.is_null() {