mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: concat 空数组实参按 ConcatSteps 展开为零元素
This commit is contained in:
@@ -412,8 +412,8 @@ pub fn array_concat<H: VmHost>(vm: &mut H, args: &[u8]) -> NativeResult {
|
||||
if !o_ptr.is_null() {
|
||||
let o = unsafe { &*o_ptr };
|
||||
let on = o.prop_count() as usize;
|
||||
// 真数组时展开元素(洞位同样留洞)。
|
||||
if o.is_array() && on > 0 {
|
||||
// 真数组时展开元素(空数组展开为零元素,贡献无;洞位同样留洞)。
|
||||
if o.is_array() {
|
||||
let dense = o.array_elements_meta_vec().is_none();
|
||||
for i in 0..on {
|
||||
if dense || !o.prop_meta_at(i).is_some_and(|m| m.is_hole()) {
|
||||
|
||||
Reference in New Issue
Block a user