Skip to content

Commit

Permalink
use a while loop instead of do...while
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar committed Feb 2, 2012
1 parent 29a4359 commit 17d0f12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backbone.js
Expand Up @@ -385,13 +385,14 @@
change: function(options) {
if (this._changing || !this.hasChanged()) return this;
this._changing = true;
this._moreChanges = true;
for (var attr in this._changed) {
this.trigger('change:' + attr, this, this._changed[attr], options);
}
do {
while (this._moreChanges) {
this._moreChanges = false;
this.trigger('change', this, options);
} while (this._moreChanges);
}
this._previousAttributes = _.clone(this.attributes);
delete this._changed;
this._changing = false;
Expand Down

0 comments on commit 17d0f12

Please sign in to comment.