mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-22 13:28:22 -05:00
fix #871 - calling set with 'attributes' property
This commit is contained in:
@@ -220,7 +220,7 @@
|
||||
// Extract attributes and options.
|
||||
options || (options = {});
|
||||
if (!attrs) return this;
|
||||
if (attrs.attributes) attrs = attrs.attributes;
|
||||
if (attrs instanceof Backbone.Model) attrs = attrs.attributes;
|
||||
if (options.unset) for (var attr in attrs) attrs[attr] = void 0;
|
||||
var now = this.attributes, escaped = this._escapedAttributes;
|
||||
|
||||
|
||||
@@ -531,4 +531,10 @@ $(document).ready(function() {
|
||||
model.set({a: 'a', b: 'b', c: 'c'});
|
||||
});
|
||||
|
||||
test("#871, set with attributes property", function() {
|
||||
var model = new Backbone.Model();
|
||||
model.set({attributes: true});
|
||||
ok(model.has('attributes'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user