jashkenas/backbone — pull request #3388 by fastest963 (2014-11-20 01:58:38+00:00)
Title: Don't allow initial attributes to affect previous()

This might break existing code utilizing this "bug". I thought I'd make a PR so we can discuss the issue but to my understanding this is a bug. The initial attributes for a model were being stored as `_previousAttributes` because of the `set` call in the constructor. This means calling `previous` without ever changing anything would return the initial value.

This breaks the following pseudo-view-code:
```JS

initialize: function(options) {
this.model.set('view', options.view);
this.listenTo(this.model, 'change:view', this.renderView);
this.renderView(this.model, options.view); //render initial passed view
},

renderView: function(model, newView) {
var previous = model.previous('view');
if (previous) { previous.destroy(); }
newView.render();
}
```
This "bug" causes `previous` var to actually be the original view passed into `options` so before we call render, we're immediately destroying the view.