mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 19:21:11 +08:00
refactor: 扁平化对象属性存储并优化常量池与 IC 热路径
This commit is contained in:
@@ -118,12 +118,12 @@ pub fn error_to_string(vm: &mut Vm, args: &[u8]) -> NativeResult {
|
||||
let name_val = obj
|
||||
.hash_props_vec()
|
||||
.and_then(|v| v.first())
|
||||
.map(|b| **b)
|
||||
.copied()
|
||||
.unwrap_or(JsValue::undefined());
|
||||
let msg_val = obj
|
||||
.hash_props_vec()
|
||||
.and_then(|v| v.get(1))
|
||||
.map(|b| **b)
|
||||
.copied()
|
||||
.unwrap_or(JsValue::undefined());
|
||||
(
|
||||
vm.lookup_str(name_val).unwrap_or_else(|| "Error".to_string()),
|
||||
|
||||
Reference in New Issue
Block a user