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

Sort plugin breaks inheritance of .splice() #35

Open
justinbmeyer opened this issue Apr 12, 2017 · 0 comments
Open

Sort plugin breaks inheritance of .splice() #35

justinbmeyer opened this issue Apr 12, 2017 · 0 comments

Comments

@justinbmeyer
Copy link
Contributor

@akagomez commented on Tue Jan 19 2016

Array.prototype.splice is called:

https://github.com/canjs/canjs/blob/master/list/sort/sort.js#L379

It should use oldSplice:

https://github.com/canjs/canjs/blob/master/list/sort/sort.js#L404


@rjgotten commented on Wed Jan 20 2016

@akagomez
Isn't it using the direct Array.prototype.splice in that location exactly because it's necessary to avoid the change events that can.List.prototype.splice triggers?


@akagomez commented on Wed Jan 20 2016

I don't suspect so. Triggering "change" events is fine. Binding to them should be avoided.

The sort plugin triggers "add" events in the same way can.List.prototype.splice does:

https://github.com/canjs/canjs/blob/master/list/sort/sort.js#L382
https://github.com/canjs/canjs/blob/master/list/list.js#L334

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

No branches or pull requests

1 participant