mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 11:41:13 +08:00
perf: 数组整数键走独立 si 区间免字符串往返
This commit is contained in:
@@ -3,7 +3,7 @@ use oxide_types::mem::P;
|
||||
use oxide_types::object::{JsObject, PropAttributes};
|
||||
use oxide_types::value::JsValue;
|
||||
|
||||
use crate::object::{delete_own_property, walk_own_keys};
|
||||
use crate::object::{delete_own_property, key_si_to_string, walk_own_keys};
|
||||
|
||||
use oxide_runtime_api::{NativeResult, VmHost};
|
||||
|
||||
@@ -193,7 +193,7 @@ pub fn reflect_own_keys<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
let target = unsafe { &*target_ptr };
|
||||
let key_names: Vec<String> = walk_own_keys(vm, target)
|
||||
.into_iter()
|
||||
.map(|(si, _)| vm.kernel_core().perm_interner().lookup(si).unwrap_or("").to_string())
|
||||
.map(|(si, _)| key_si_to_string(vm, si))
|
||||
.collect();
|
||||
NativeResult::Ok(make_string_array(vm, &key_names))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user