optimizing slice call

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functi
ons/arguments
This commit is contained in:
Yotam Mann 2017-03-13 00:38:40 -04:00
parent 4f9143c76e
commit 84bbdb5c04

View file

@ -79,7 +79,7 @@ define(["Tone/core/Tone"], function (Tone) {
*/
Tone.Emitter.prototype.emit = function(event){
if (this._events){
var args = Array.prototype.slice.call(arguments, 1);
var args = Array.apply(null, arguments).slice(1);
if (this._events.hasOwnProperty(event)){
var eventList = this._events[event];
for (var i = 0, len = eventList.length; i < len; i++){