2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-24 14:04:14 +03:00

Don't call slice on arguments

Calling slice on arguments can prevent optimizations in some JS engines
(see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments).
This commit is contained in:
Colin Timmermans
2015-10-28 11:25:40 +01:00
parent 11c12b2c65
commit d6bcd62e4b
+5 -1
View File
@@ -105,6 +105,10 @@ axios.interceptors = defaultInstance.interceptors;
// Helpers
function bind (fn, thisArg) {
return function () {
return fn.apply(thisArg, Array.prototype.slice.call(arguments));
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
}