[Pkg-javascript-commits] [backbone] 01/34: willbailey's patch to use getByCid for internal lookups ... much safer.
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 16:58:43 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.1.2
in repository backbone.
commit eb9f54c8fe9efa878093fa24a32755ad7d6fd43d
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Thu Oct 14 07:36:11 2010 -0400
willbailey's patch to use getByCid for internal lookups ... much safer.
---
backbone.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/backbone.js b/backbone.js
index 3a029d0..bc08d58 100644
--- a/backbone.js
+++ b/backbone.js
@@ -422,7 +422,7 @@
// hash indexes for `id` and `cid` lookups.
_add : function(model, options) {
options || (options = {});
- var already = this.get(model);
+ var already = this.getByCid(model);
if (already) throw new Error(["Can't add the same model to a set twice", already.id]);
this._byId[model.id] = model;
this._byCid[model.cid] = model;
@@ -439,7 +439,7 @@
// hash indexes for `id` and `cid` lookups.
_remove : function(model, options) {
options || (options = {});
- model = this.get(model);
+ model = this.getByCid(model);
if (!model) return null;
delete this._byId[model.id];
delete this._byCid[model.cid];
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list