diff --git a/backbone.js b/backbone.js index 87daa0dc..74becaa6 100644 --- a/backbone.js +++ b/backbone.js @@ -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; diff --git a/test/model.js b/test/model.js index e1b9f87f..9ad45d27 100644 --- a/test/model.js +++ b/test/model.js @@ -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')); + }); + });