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

Fix can.List.prototype.splice when items are similar but not the same #1635

Merged
merged 1 commit into from
Apr 21, 2015

Conversation

daffl
Copy link
Contributor

@daffl daffl commented Apr 21, 2015

can.List.prototype.splice checks if newly spliced items are the same but does not account for the length of the current and new item array being different so something like

var list = new can.List([ 'aa', 'bb', 'cc']);
list.splice(0, list.length, 'aa', 'bb');

Would fail with the list still being [ 'aa', 'bb', 'cc']. Closes #1606.

…items are the same even if the length is different (#1606).
daffl added a commit that referenced this pull request Apr 21, 2015
Fix can.List.prototype.splice when items are similar but not the same
@daffl daffl merged commit 4e52164 into master Apr 21, 2015
@daffl daffl deleted the splice-same-1606 branch April 21, 2015 22:51
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.

CanJS 2.2.4 can.List.replace() incorrect behavior
1 participant