Skip to content

Commit f58ba51

Browse files
committed
chore: fix more bugs with using let/const
1 parent 9bdf98e commit f58ba51

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

features/dynamodb/step_definitions/dynamodb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function createTable(world, callback) {
9292
Given(/^I have a table$/, function(callback) {
9393
const world = this;
9494
this.service.listTables({}, function(err, data) {
95-
for (const i = 0; i < data.TableNames.length; i++) {
95+
for (let i = 0; i < data.TableNames.length; i++) {
9696
if (data.TableNames[i] == world.tableName) {
9797
callback();
9898
return;
@@ -106,7 +106,7 @@ When(/^I create a table$/, function(callback) {
106106
const world = this;
107107
this.tableName = this.uniqueName("aws-sdk-js-integration");
108108
this.service.listTables({}, function(err, data) {
109-
for (const i = 0; i < data.TableNames.length; i++) {
109+
for (let i = 0; i < data.TableNames.length; i++) {
110110
if (data.TableNames[i] == world.tableName) {
111111
callback();
112112
return;

features/extra/assertions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ assert.match = function assertMatches(string, matcher, message) {
99

1010
assert.contains = function assertContains(list, matcher, message) {
1111
let found = false;
12-
for (const i in list) {
13-
if (!list.hasOwnProperty(i)) continue;
12+
for (const itemIndex in list) {
13+
if (!list.hasOwnProperty(itemIndex)) continue;
1414
if (typeof matcher === "function") {
15-
found = matcher(list[i]);
15+
found = matcher(list[itemIndex]);
1616
} else {
17-
found = list[i] === matcher;
17+
found = list[itemIndex] === matcher;
1818
}
1919
if (found) return;
2020
}

features/sqs/step_definitions/queues.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Then(/^list queues should eventually return the queue urls$/, function(
1818
callback,
1919
function(next) {
2020
next.condition = function() {
21-
const matchingCount = 0;
22-
for (const i = 0; i < this.createdQueues.length; ++i) {
23-
for (const j = 0; j < this.data.QueueUrls.length; ++j) {
21+
let matchingCount = 0;
22+
for (let i = 0; i < this.createdQueues.length; ++i) {
23+
for (let j = 0; j < this.data.QueueUrls.length; ++j) {
2424
if (this.createdQueues[i] == this.data.QueueUrls[j]) {
2525
matchingCount++;
2626
}

0 commit comments

Comments
 (0)