Skip to content

Commit

Permalink
Merge pull request #481 from shesek/master
Browse files Browse the repository at this point in the history
Setting "this" context on a defaults() function
  • Loading branch information
jashkenas committed Jul 18, 2011
2 parents 48cfa5a + 909c427 commit 8b3ca51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
var defaults;
attributes || (attributes = {});
if (defaults = this.defaults) {
if (_.isFunction(defaults)) defaults = defaults();
if (_.isFunction(defaults)) defaults = defaults.call(this);
attributes = _.extend({}, defaults, attributes);
}
this.attributes = {};
Expand Down

0 comments on commit 8b3ca51

Please sign in to comment.