fix: for-in 整数索引升序+字符串插入序枚举,null/undefined 空遍历
This commit is contained in:
@@ -103,7 +103,9 @@ pub struct CallFrame {
|
||||
}
|
||||
|
||||
pub struct ForInIter<'bump> {
|
||||
pub keys: bumpalo::collections::Vec<'bump, JsValue>,
|
||||
/// Each key paired with its string-intern id, so for-in can sort
|
||||
/// integer-index keys ahead of string keys without re-interning.
|
||||
pub keys: bumpalo::collections::Vec<'bump, (JsValue, u32)>,
|
||||
pub index: usize,
|
||||
}
|
||||
|
||||
@@ -358,8 +360,8 @@ impl Vm {
|
||||
continue;
|
||||
}
|
||||
unsafe {
|
||||
for &v in (*(*iter)).keys.iter() {
|
||||
f(v);
|
||||
for (v, _si) in (*(*iter)).keys.iter() {
|
||||
f(*v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user