Merge pull request #3489 from jridgewell/trigger-for-slice

Use for-loop, instead of slice
This commit is contained in:
Jeremy Ashkenas
2015-02-23 10:58:19 -05:00

View File

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