Merge pull request #481 from shesek/master

Setting "this" context on a defaults() function
This commit is contained in:
Jeremy Ashkenas
2011-07-18 06:03:43 -07:00

View File

@@ -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 = {};