Skip to content

Commit 4abcaa5

Browse files
authored
Merge pull request #4267 from jgonggrijp/feature/comment-about-combined-defaults-and-extend
Comment about combined defaults and extend
2 parents 3b37e6a + 790682c commit 4abcaa5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backbone.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@
404404
if (options.collection) this.collection = options.collection;
405405
if (options.parse) attrs = this.parse(attrs, options) || {};
406406
var defaults = _.result(this, 'defaults');
407+
408+
// Just _.defaults would work fine, but the additional _.extends
409+
// is in there for historical reasons. See #3843.
407410
attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
411+
408412
this.set(attrs, options);
409413
this.changed = {};
410414
this.initialize.apply(this, arguments);

0 commit comments

Comments
 (0)