[Pkg-javascript-commits] [backbone] 02/28: Setting to context to `this` by default on bind() instead of trigger()

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:01:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.3
in repository backbone.

commit 39b36afd744b0cc218e55831c25aa7f58798317f
Author: Nadav <nadav at shesek.info>
Date:   Tue Jul 26 21:27:10 2011 +0300

    Setting to context to `this` by default on bind() instead of trigger()
---
 backbone.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backbone.js b/backbone.js
index 62da3bd..b4ac727 100644
--- a/backbone.js
+++ b/backbone.js
@@ -71,7 +71,7 @@
     bind : function(ev, callback, context) {
       var calls = this._callbacks || (this._callbacks = {});
       var list  = calls[ev] || (calls[ev] = []);
-      list.push([callback, context]);
+      list.push([callback, context||this]);
       return this;
     },
 
@@ -114,7 +114,7 @@
               list.splice(i, 1); i--; l--;
             } else {
               args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
-              callback[0].apply(callback[1] || this, args);
+              callback[0].apply(callback[1], args);
             }
           }
         }

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