diff --git a/src/Signal.js b/src/Signal.js index 23469c6..338cc01 100644 --- a/src/Signal.js +++ b/src/Signal.js @@ -205,9 +205,18 @@ if (! this.active) { return; } + + /** + * When copying the arguments variable using Array.prototype.slice.call V8 disables optimization for the calling method. + * We avoid this issue here by coping arguments to a pre-allocated array. + * see https://code.google.com/p/v8/issues/detail?id=3037 + */ + var len = arguments.length, paramsArr = new Array(len); + for (var i=0; i < len; ++i) { + paramsArr[i] = arguments[i]; + } - var paramsArr = Array.prototype.slice.call(arguments), - n = this._bindings.length, + var n = this._bindings.length, bindings; if (this.memorize) {