Skip to content

Conversation

SuchAFuriousDeath
Copy link
Contributor

@SuchAFuriousDeath SuchAFuriousDeath commented Sep 18, 2025

The insertremove test seems to indicate that removeAt needs the same resolve_array_hole logic that splice has.
Hence, I created splice_internal that splice, insertAt and removeAt are now expressed in terms of.

Also, insertAt previously returned an array with the removed elements, which it seems it should not do (The function signature doesn't suggest it should and there are no tests for it). Now it just returns undefined.

Splice_internal also collects directly into an ArrayStorage instead of an intermediate Vec as that seemed unnecessary.

@danielhjacobs danielhjacobs added A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already) labels Sep 18, 2025
@kjarosh
Copy link
Member

kjarosh commented Sep 18, 2025

There were discussions about it with @adrian17. TL;DR the behavior is different for dense/sparse/simple/... arrays, FP has fast paths. We should probably add tests and cover all those cases before we do significant refactors

@SuchAFuriousDeath
Copy link
Contributor Author

I'll take a look at that.

@SuchAFuriousDeath SuchAFuriousDeath marked this pull request as draft September 18, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants