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

@@ -113,7 +113,7 @@ class Launcher {
* @return {!Promise<!Browser>}
*/
static async connect({browserWSEndpoint, ignoreHTTPSErrors = false}) {
let connection = await Connection.create(browserWSEndpoint);
const connection = await Connection.create(browserWSEndpoint);
return new Browser(connection, !!ignoreHTTPSErrors);
}
}
@@ -127,12 +127,12 @@ function waitForWSEndpoint(chromeProcess, timeout) {
return new Promise((resolve, reject) => {
const rl = readline.createInterface({ input: chromeProcess.stderr });
let stderr = '';
let listeners = [
const listeners = [
helper.addEventListener(rl, 'line', onLine),
helper.addEventListener(rl, 'close', onClose),
helper.addEventListener(chromeProcess, 'exit', onClose)
];
let timeoutId = timeout ? setTimeout(onTimeout, timeout) : 0;
const timeoutId = timeout ? setTimeout(onTimeout, timeout) : 0;
function onClose() {
cleanup();