[Pkg-javascript-commits] [backbone] 07/34: internal Collection#_add and Collection#_remove, should return the model, in case they're overridden.

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 82365e392ea471c504ebcd3787d2d71578ec644b
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Thu Oct 14 13:04:11 2010 -0400

    internal Collection#_add and Collection#_remove, should return the model, in case they're overridden.
---
 backbone.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/backbone.js b/backbone.js
index 20e5fa6..cb407ea 100644
--- a/backbone.js
+++ b/backbone.js
@@ -441,6 +441,7 @@
       model.bind('all', this._boundOnModelEvent);
       this.length++;
       if (!options.silent) this.trigger('add', model);
+      return model;
     },
 
     // Internal implementation of removing a single model from the set, updating
@@ -456,6 +457,7 @@
       model.unbind('all', this._boundOnModelEvent);
       this.length--;
       if (!options.silent) this.trigger('remove', model);
+      return model;
     },
 
     // Internal method called every time a model in the set fires an event.

-- 
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