|
273 | 273 | // once for each event, not once for a combination of all events. |
274 | 274 | Events.once = function(name, callback, context) { |
275 | 275 | // Map the event into a `{event: once}` object. |
276 | | - var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this)); |
| 276 | + var events = eventsApi(onceMap, {}, name, callback, this.off.bind(this)); |
277 | 277 | if (typeof name === 'string' && context == null) callback = void 0; |
278 | 278 | return this.on(events, callback, context); |
279 | 279 | }; |
280 | 280 |
|
281 | 281 | // Inversion-of-control versions of `once`. |
282 | 282 | Events.listenToOnce = function(obj, name, callback) { |
283 | 283 | // Map the event into a `{event: once}` object. |
284 | | - var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj)); |
| 284 | + var events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj)); |
285 | 285 | return this.listenTo(obj, events); |
286 | 286 | }; |
287 | 287 |
|
|
1030 | 1030 | options || (options = {}); |
1031 | 1031 |
|
1032 | 1032 | var length = comparator.length; |
1033 | | - if (_.isFunction(comparator)) comparator = _.bind(comparator, this); |
| 1033 | + if (_.isFunction(comparator)) comparator = comparator.bind(this); |
1034 | 1034 |
|
1035 | 1035 | // Run sort based on type of `comparator`. |
1036 | 1036 | if (length === 1 || _.isString(comparator)) { |
|
1389 | 1389 | if (!_.isFunction(method)) method = this[method]; |
1390 | 1390 | if (!method) continue; |
1391 | 1391 | var match = key.match(delegateEventSplitter); |
1392 | | - this.delegate(match[1], match[2], _.bind(method, this)); |
| 1392 | + this.delegate(match[1], match[2], method.bind(this)); |
1393 | 1393 | } |
1394 | 1394 | return this; |
1395 | 1395 | }, |
|
1744 | 1744 | // falls back to polling. |
1745 | 1745 | var History = Backbone.History = function() { |
1746 | 1746 | this.handlers = []; |
1747 | | - this.checkUrl = _.bind(this.checkUrl, this); |
| 1747 | + this.checkUrl = this.checkUrl.bind(this); |
1748 | 1748 |
|
1749 | 1749 | // Ensure that `History` can be used outside of the browser. |
1750 | 1750 | if (typeof window !== 'undefined') { |
|
0 commit comments