Replaced uses of var with const/let
This commit is contained in:
@@ -19,8 +19,7 @@ getJasmineRequireObj().ArrayContaining = function(j$) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.sample.length; i++) {
|
||||
var item = this.sample[i];
|
||||
for (const item of this.sample) {
|
||||
if (!matchersUtil.contains(other, item)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@ getJasmineRequireObj().ArrayWithExactContents = function(j$) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.sample.length; i++) {
|
||||
var item = this.sample[i];
|
||||
for (const item of this.sample) {
|
||||
if (!matchersUtil.contains(other, item)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ getJasmineRequireObj().MapContaining = function(j$) {
|
||||
for (const [key, value] of this.sample) {
|
||||
// for each key/value pair in `sample`
|
||||
// there should be at least one pair in `other` whose key and value both match
|
||||
var hasMatch = false;
|
||||
let hasMatch = false;
|
||||
for (const [oKey, oValue] of other) {
|
||||
if (
|
||||
matchersUtil.equals(oKey, key) &&
|
||||
|
||||
@@ -27,7 +27,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var property in this.sample) {
|
||||
for (const property in this.sample) {
|
||||
if (
|
||||
!hasProperty(other, property) ||
|
||||
!matchersUtil.equals(this.sample[property], other[property])
|
||||
@@ -47,7 +47,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
};
|
||||
}
|
||||
|
||||
var filteredOther = {};
|
||||
const filteredOther = {};
|
||||
Object.keys(this.sample).forEach(function(k) {
|
||||
// eq short-circuits comparison of objects that have different key sets,
|
||||
// so include all keys even if undefined.
|
||||
|
||||
@@ -17,7 +17,7 @@ getJasmineRequireObj().SetContaining = function(j$) {
|
||||
// for each item in `sample` there should be at least one matching item in `other`
|
||||
// (not using `matchersUtil.contains` because it compares set members by reference,
|
||||
// not by deep value equality)
|
||||
var hasMatch = false;
|
||||
let hasMatch = false;
|
||||
for (const oItem of other) {
|
||||
if (matchersUtil.equals(oItem, item)) {
|
||||
hasMatch = true;
|
||||
|
||||
Reference in New Issue
Block a user