Replaced uses of var with const/let

This commit is contained in:
Steve Gravrock
2022-06-08 19:07:43 -07:00
parent 4af86f5398
commit 135ff20123
73 changed files with 1384 additions and 1391 deletions

View File

@@ -4,8 +4,8 @@ getJasmineRequireObj().CallTracker = function(j$) {
* @since 2.0.0
*/
function CallTracker() {
var calls = [];
var opts = {};
let calls = [];
const opts = {};
this.track = function(context) {
if (opts.cloneArgs) {
@@ -45,7 +45,7 @@ getJasmineRequireObj().CallTracker = function(j$) {
* @return {Array}
*/
this.argsFor = function(index) {
var call = calls[index];
const call = calls[index];
return call ? call.args : [];
};
@@ -58,7 +58,7 @@ getJasmineRequireObj().CallTracker = function(j$) {
* @return {Object?}
*/
this.thisFor = function(index) {
var call = calls[index];
const call = calls[index];
return call ? call.object : undefined;
};
@@ -81,12 +81,7 @@ getJasmineRequireObj().CallTracker = function(j$) {
* @return {Array}
*/
this.allArgs = function() {
var callArgs = [];
for (var i = 0; i < calls.length; i++) {
callArgs.push(calls[i].args);
}
return callArgs;
return calls.map(c => c.args);
};
/**