mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Merge pull request #3489 from jridgewell/trigger-for-slice
Use for-loop, instead of slice
This commit is contained in:
@@ -277,7 +277,10 @@
|
||||
// receive the true name of the event as the first argument).
|
||||
Events.trigger = function(name) {
|
||||
if (!this._events) return this;
|
||||
var args = slice.call(arguments, 1);
|
||||
|
||||
var length = Math.max(0, arguments.length - 1);
|
||||
var args = Array(length);
|
||||
for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
|
||||
|
||||
eventsApi(triggerApi, this, name, void 0, args);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user