Change let into const (#457)

This patch:
- changes `let` into `const` throughout codebase
- adds eslint check to prefer const over let
This commit is contained in:
Eric Bidelman
2017-08-21 16:39:04 -07:00
committed by Andrey Lushnikov
parent 5d6d3e0a81
commit 1f9b4fb4c8
37 changed files with 495 additions and 494 deletions

View File

@@ -25,7 +25,7 @@ const utils = module.exports = {
await page.evaluate(attachFrame, frameId, url);
function attachFrame(frameId, url) {
let frame = document.createElement('iframe');
const frame = document.createElement('iframe');
frame.src = url;
frame.id = frameId;
document.body.appendChild(frame);
@@ -42,7 +42,7 @@ const utils = module.exports = {
await page.evaluate(detachFrame, frameId);
function detachFrame(frameId) {
let frame = document.getElementById(frameId);
const frame = document.getElementById(frameId);
frame.remove();
}
},
@@ -57,7 +57,7 @@ const utils = module.exports = {
await page.evaluate(navigateFrame, frameId, url);
function navigateFrame(frameId, url) {
let frame = document.getElementById(frameId);
const frame = document.getElementById(frameId);
frame.src = url;
return new Promise(x => frame.onload = x);
}
@@ -71,7 +71,7 @@ const utils = module.exports = {
dumpFrames: function(frame, indentation) {
indentation = indentation || '';
let result = indentation + frame.url();
for (let child of frame.childFrames())
for (const child of frame.childFrames())
result += '\n' + utils.dumpFrames(child, ' ' + indentation);
return result;
},