documentcloud/backbone — Issue #963: Unrelated change:attr events triggered
Author: robinduckett
Created: 2012-02-06 13:43:59+00:00
State: open

Example code:

``` javascript
window.onload = function() {
var Test = Backbone.Model.extend({
defaults: {
testValue: 0
, testValue: 0
},

initialize: function() {
this.on('change:testValue', function() {
console.log('this should not fire');
console.log('new value:', this.get('testValue'));
});

this.on('change:testValue2', function() {
console.log('this should fire');
console.log('new value2:', this.get('testValue2'));
});
},
});

var test = new Test();

test.set({testValue: 5}, {silent: true});
test.set({testValue2: 5});
};
```

I'm fairly certain this is not correct behaviour. If I had changed fifty attributes silently and then set ONE normally I would not expect it to fire all these attributes.