Reference calls variable in list variable definition in Backbone.Events.bind

This commit is contained in:
Damien Holzapfel
2011-04-27 10:38:13 -07:00
parent 58708b3cec
commit 7afd43c0ef

View File

@@ -70,7 +70,7 @@
// Passing `"all"` will bind the callback to all events fired.
bind : function(ev, callback) {
var calls = this._callbacks || (this._callbacks = {});
var list = this._callbacks[ev] || (this._callbacks[ev] = []);
var list = calls[ev] || (calls[ev] = []);
list.push(callback);
return this;
},