From cd1b82bb76f94892b58b283da88ffb718d067039 Mon Sep 17 00:00:00 2001 From: Emil Broman <54805761+emilbroman-eqt@users.noreply.github.com> Date: Wed, 22 Dec 2021 19:58:12 +0100 Subject: [PATCH] Removing code relying on strict mode behaviour for arguments (#3470) Co-authored-by: Jay --- lib/core/Axios.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/Axios.js b/lib/core/Axios.js index 613af54d42..a1be08adae 100644 --- a/lib/core/Axios.js +++ b/lib/core/Axios.js @@ -26,14 +26,14 @@ function Axios(instanceConfig) { * * @param {Object} config The config specific for this request (merged with this.defaults) */ -Axios.prototype.request = function request(config) { +Axios.prototype.request = function request(configOrUrl, config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { + if (typeof configOrUrl === 'string') { config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; } config = mergeConfig(this.defaults, config);