refactor: 哈希表存储属性以支持无上限属性个数
This commit is contained in:
@@ -284,7 +284,7 @@ pub fn to_object(val: JsValue, vm: &mut Vm) -> Result<JsValue, &'static str> {
|
||||
.alloc(JsObject::new_empty(EMPTY_SHAPE_ID, proto_val));
|
||||
let obj_val = JsValue::from_js_object(obj);
|
||||
let obj_ref = unsafe { &mut *obj };
|
||||
obj_ref.set_inline_prop(0, val);
|
||||
obj_ref.ensure_hash_props().push(Box::new(val));
|
||||
obj_ref.set_prop_count(1);
|
||||
Ok(obj_val)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user