bitovi/canjs — pull request #154 by iamnoah (2012-11-14 19:23:13+00:00)
Title: don't modify passed in array

This is an edge case, but really hard to debug when it happens. If you pass an array to Model.List.remove, the array is modified by remove (there is an args.splice a few lines down). In our case, the array happened to be the removed list from another remove event, so the list ended up empty for subsequent listeners.
e.g.,

```javascript
var listA = ...;
var listB = ...;

// whenever we remove from listA, we remove from listB
listA.bind("remove",function(ev,removed) {
listB.remove(removed);
});
listA.bind("remove",function(ev,removed) {
// removed is empty!
});
```