Skip to content

fix(core): Avoid splicing arrays using a negative start index#10679

Merged
NathanWalker merged 2 commits into
NativeScript:mainfrom
CatchABus:fix/index-of-checks
Jan 30, 2025
Merged

fix(core): Avoid splicing arrays using a negative start index#10679
NathanWalker merged 2 commits into
NativeScript:mainfrom
CatchABus:fix/index-of-checks

Conversation

@CatchABus
Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

There are cases when core splices arrays using a negative index.
This can have bad consequences as splice negative index counts back from the end of the array.
For example, calling LayoutBase.removeChild to remove a view that is not an actual child will unexpectedly remove an existing child from the caller layout.

What is the new behavior?

Added index checking for 4 array splice calls that were error-prone.

@NathanWalker NathanWalker merged commit 9bd147c into NativeScript:main Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants