Skip to content

Commit 2867559

Browse files
committed
avm2: Array push/unshift return new length, like Vector
1 parent 758a46c commit 2867559

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/avm2/globals/array.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ pub fn push<'gc>(
577577
for arg in args {
578578
array.push(*arg)
579579
}
580+
return Ok(array.length().into());
580581
}
581582
}
582583

@@ -646,6 +647,7 @@ pub fn unshift<'gc>(
646647
for arg in args.iter().rev() {
647648
array.unshift(*arg)
648649
}
650+
return Ok(array.length().into());
649651
}
650652
}
651653

0 commit comments

Comments
 (0)