mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-20 20:37:59 -05:00
Merge branch 'master' of github.com:documentcloud/backbone
This commit is contained in:
@@ -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};
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user