Skip to content
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

supply correct start parameter to insertElements #6008

Merged
merged 2 commits into from Jan 25, 2019

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Jan 23, 2019

in onDataPush, data is already in the data array.

So say the data was [1,2,3] before push and [4,5,6] was pushed.
Because data is already in place here, data.length would be 6 so start parameter would have been 5 to insertElement.

splice is executed on meta.data there, with given the index relative to start.
In
MDN its said about start: "If greater than the length of the array, actual starting index will be set to the length of the array."
So the wrong start is fixed by splice.

However, when used for something else (I did), then things would go wrong. So this might as well be fixed for possible future changes.

@simonbrunel simonbrunel added this to the Version 2.8 milestone Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants