mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Merge pull request #481 from shesek/master
Setting "this" context on a defaults() function
This commit is contained in:
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user