mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
committed by
Andrey Lushnikov
parent
5d6d3e0a81
commit
1f9b4fb4c8
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user