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:
+5
-1
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user