Replaced var with let and const in PrettyPrinter, DiffBuilder, and friends

This commit is contained in:
Steve Gravrock
2022-05-12 17:15:50 -07:00
parent bb4d18f959
commit 2fd76c954c
5 changed files with 146 additions and 198 deletions

View File

@@ -5,7 +5,7 @@ getJasmineRequireObj().ObjectPath = function(j$) {
ObjectPath.prototype.toString = function() {
if (this.components.length) {
return '$' + map(this.components, formatPropertyAccess).join('');
return '$' + this.components.map(formatPropertyAccess).join('');
} else {
return '';
}
@@ -35,14 +35,6 @@ getJasmineRequireObj().ObjectPath = function(j$) {
return "['" + prop + "']";
}
function map(array, fn) {
var results = [];
for (var i = 0; i < array.length; i++) {
results.push(fn(array[i]));
}
return results;
}
function isValidIdentifier(string) {
return /^[A-Za-z\$_][A-Za-z0-9\$_]*$/.test(string);
}