Merge branch 'master' of github.com:documentcloud/backbone

This commit is contained in:
Jeremy Ashkenas
2012-02-08 16:59:11 -05:00
2 changed files with 8 additions and 2 deletions

View File

@@ -594,7 +594,7 @@
// Get a model from the set by id.
get: function(id) {
if (id == null) return null;
if (id == null) return void 0;
return this._byId[id.id != null ? id.id : id];
},
@@ -979,7 +979,7 @@
//
// The options object can contain `trigger: true` if you wish to have the
// route callback be fired (not usually desirable), or `replace: true`, if
// you which to modify the current URL without adding an entry to the history.
// you wish to modify the current URL without adding an entry to the history.
navigate: function(fragment, options) {
if (!historyStarted) return false;
if (!options || options === true) options = {trigger: options};

View File

@@ -522,4 +522,10 @@ $(document).ready(function() {
raises(function() { col.add([{id: 1}, {id: 1}]); });
});
test("#964 - collection.get return in consistent", function() {
var c = new Backbone.Collection();
ok(c.get(null) === undefined);
ok(c.get() === undefined);
});
});