From 82365e392ea471c504ebcd3787d2d71578ec644b Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 14 Oct 2010 13:04:11 -0400 Subject: [PATCH] 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 20e5fa6b..cb407ea9 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.