Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

CatchABus
Copy link
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
0 of 3 checks passed
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