feat: 实现for-of与解构赋值

This commit is contained in:
2026-06-14 23:45:12 +08:00
parent 5238ba426a
commit 391566ba5b
15 changed files with 891 additions and 81 deletions
+7
View File
@@ -23,6 +23,13 @@ impl Vm {
if obj.is_array() && prop_name_si == length_si {
return Ok(JsValue::int(obj.prop_count() as i32));
}
if obj.is_array() {
if let Some(index) = self.array_index_from_property_key(prop_name_si) {
if index < obj.prop_vec_len() as u32 {
return Ok(obj.get_prop_at(index));
}
}
}
if let Some(pos) = self.get_own_property_slot(obj, prop_name_si) {
if let Some(meta) = obj.prop_meta_at(pos) {
if meta.is_accessor {