Bug 1252803 - Enable ESLint on the rest of devtools (automatic changes). r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D57223

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Marco Vega 2020-02-03 11:31:24 +00:00
parent 05fe451e43
commit 8a787e9be0
12 changed files with 81 additions and 81 deletions

View File

@ -30,32 +30,32 @@
</style>
<script type="application/javascript">
function init() {
let container = document.getElementById("container");
let multiple = document.getElementById("multiple");
const container = document.getElementById("container");
const multiple = document.getElementById("multiple");
container.addEventListener("mouseover", mouseoverHandler, true);
multiple.addEventListener("click", clickHandler, false);
multiple.addEventListener("mouseup", mouseupHandler, false);
multiple.addEventListener("click", clickHandler);
multiple.addEventListener("mouseup", mouseupHandler);
let he = new handleEventClick();
let handleevent = document.getElementById("handleevent");
const he = new handleEventClick();
const handleevent = document.getElementById("handleevent");
handleevent.addEventListener("click", he);
}
function mouseoverHandler(event) {
if (event.target.id !== "container") {
let output = document.getElementById("output");
const output = document.getElementById("output");
output.textContent = event.target.textContent;
}
}
function clickHandler(event) {
let output = document.getElementById("output");
const output = document.getElementById("output");
output.textContent = "click";
}
function mouseupHandler(event) {
let output = document.getElementById("output");
const output = document.getElementById("output");
output.textContent = "mouseup";
}
@ -74,12 +74,12 @@
}
function addNoeventsClickHandler() {
let noevents = document.getElementById("noevents");
const noevents = document.getElementById("noevents");
noevents.addEventListener("click", noeventsClickHandler);
}
function removeNoeventsClickHandler() {
let noevents = document.getElementById("noevents");
const noevents = document.getElementById("noevents");
noevents.removeEventListener("click", noeventsClickHandler);
}
</script>

View File

@ -18,21 +18,21 @@
</style>
<script type="application/javascript">
function init() {
let fatarrow = document.getElementById("fatarrow");
const fatarrow = document.getElementById("fatarrow");
let he = new handleEventClick();
let anonObjectMethod = document.getElementById("anon-object-method");
const he = new handleEventClick();
const anonObjectMethod = document.getElementById("anon-object-method");
anonObjectMethod.addEventListener("click", he.anonObjectMethod);
let objectMethod = document.getElementById("object-method");
const objectMethod = document.getElementById("object-method");
objectMethod.addEventListener("click", he.objectMethod);
let bhe = new boundHandleEventClick();
let boundheNode = document.getElementById("boundhe");
const bhe = new boundHandleEventClick();
const boundheNode = document.getElementById("boundhe");
bhe.handleEvent = bhe.handleEvent.bind(bhe);
boundheNode.addEventListener("click", bhe);
let boundNode = document.getElementById("bound");
const boundNode = document.getElementById("bound");
boundClickHandler = boundClickHandler.bind(this);
boundNode.addEventListener("click", boundClickHandler);
@ -50,11 +50,11 @@
fatarrow.addEventListener("click", b => b);
let inlineCommentNode = document.getElementById("comment-inline");
const inlineCommentNode = document.getElementById("comment-inline");
inlineCommentNode
.addEventListener("click", functionProceededByInlineComment);
let streamingCommentNode = document.getElementById("comment-streaming");
const streamingCommentNode = document.getElementById("comment-streaming");
streamingCommentNode
.addEventListener("click", functionProceededByStreamingComment);
}

View File

@ -16,45 +16,45 @@
}
</style>
<script type="application/javascript">
let namedFunctionExpression =
const namedFunctionExpression =
function foo() {
alert("namedFunctionExpression");
}
let anonFunctionExpression = function() {
const anonFunctionExpression = function() {
alert("anonFunctionExpression");
};
let returnedFunction = (function() {
const returnedFunction = (function() {
return function bar() {
alert("returnedFunction");
}
})();
function init() {
let em = new Es6Method();
let es6Method = document.getElementById("es6-method");
const em = new Es6Method();
const es6Method = document.getElementById("es6-method");
es6Method.addEventListener("click", em.es6Method);
let generatorNode = document.getElementById("generator");
const generatorNode = document.getElementById("generator");
generatorNode.addEventListener("click", generator);
let anonGenerator = document.getElementById("anon-generator");
const anonGenerator = document.getElementById("anon-generator");
anonGenerator.addEventListener("click", function* () {
alert("anonGenerator");
});
let namedFunctionExpressionNode =
const namedFunctionExpressionNode =
document.getElementById("named-function-expression");
namedFunctionExpressionNode.addEventListener("click",
namedFunctionExpression);
let anonFunctionExpressionNode =
const anonFunctionExpressionNode =
document.getElementById("anon-function-expression");
anonFunctionExpressionNode.addEventListener("click",
anonFunctionExpression);
let returnedFunctionNode = document.getElementById("returned-function");
const returnedFunctionNode = document.getElementById("returned-function");
returnedFunctionNode.addEventListener("click", returnedFunction);
}
@ -69,7 +69,7 @@
};
function HandleEvent() {
let handleEventNode = document.getElementById("handleEvent");
const handleEventNode = document.getElementById("handleEvent");
handleEventNode.addEventListener("click", this);
}

View File

@ -16,35 +16,35 @@
}
</style>
<script type="application/javascript">
let constructedFunc = new Function();
const constructedFunc = new Function();
let constructedFuncWithBodyString =
const constructedFuncWithBodyString =
new Function('a', 'b', 'c', 'alert("constructedFuncWithBodyString");');
let multipleAssignment = foo = bar = function multi() {
const multipleAssignment = foo = bar = function multi() {
alert("multipleAssignment");
}
function init() {
let constructedFunctionNode =
const constructedFunctionNode =
document.getElementById("constructed-function");
constructedFunctionNode.addEventListener("click", constructedFunc);
let constructedFunctionWithBodyStringNode =
const constructedFunctionWithBodyStringNode =
document.getElementById("constructed-function-with-body-string");
constructedFunctionWithBodyStringNode
.addEventListener("click", constructedFuncWithBodyString);
let multipleAssignmentNode =
const multipleAssignmentNode =
document.getElementById("multiple-assignment");
multipleAssignmentNode.addEventListener("click", multipleAssignment);
let promiseNode = document.getElementById("promise");
const promiseNode = document.getElementById("promise");
new Promise((resolve, reject) => {
promiseNode.addEventListener("click", resolve);
});
let mathPowNode = document.getElementById("math-pow");
const mathPowNode = document.getElementById("math-pow");
mathPowNode.addEventListener("click", Math.pow);
new HandleEvent();
@ -69,7 +69,7 @@
};
function HandleEvent() {
let handleEventNode = document.getElementById("handleEvent");
const handleEventNode = document.getElementById("handleEvent");
handleEventNode.addEventListener("click", this);
}

View File

@ -16,9 +16,9 @@
</style>
<script type="application/javascript">
let jq = document.location.search.substr(1);
const jq = document.location.search.substr(1);
let script = document.createElement("script");
const script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", jq);

View File

@ -15,9 +15,9 @@ Test the rendering of the JIT Optimizations tree. Tests when jit data has observ
<script type="application/javascript">
window.onload = async function () {
try {
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
let React = browserRequire("devtools/client/shared/vendor/react");
let JITOptimizations = React.createFactory(browserRequire("devtools/client/performance/components/JITOptimizations"));
const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
const React = browserRequire("devtools/client/shared/vendor/react");
const JITOptimizations = React.createFactory(browserRequire("devtools/client/performance/components/JITOptimizations"));
ok(JITOptimizations, "Should get JITOptimizations");
let opts;

View File

@ -18,8 +18,8 @@ window.removeCookie = function (name) {
};
window.clearCookies = function () {
let cookies = document.cookie;
for (let cookie of cookies.split(";")) {
const cookies = document.cookie;
for (const cookie of cookies.split(";")) {
removeCookie(cookie.split("=")[0]);
}
};

View File

@ -26,18 +26,18 @@ localStorage.setItem("ls2", "foobar-2");
// ... and finally some session storage items too
sessionStorage.setItem("ss1", "foobar-3");
let idbGenerator = async function () {
const idbGenerator = async function () {
let request = indexedDB.open("idb1", 1);
request.onerror = function() {
throw new Error("error opening db connection");
};
let db = await new Promise(done => {
const db = await new Promise(done => {
request.onupgradeneeded = event => {
let db = event.target.result;
let store1 = db.createObjectStore("obj1", { keyPath: "id" });
const db = event.target.result;
const store1 = db.createObjectStore("obj1", { keyPath: "id" });
store1.createIndex("name", "name", { unique: false });
store1.createIndex("email", "email", { unique: true });
let store2 = db.createObjectStore("obj2", { keyPath: "id2" });
const store2 = db.createObjectStore("obj2", { keyPath: "id2" });
store1.transaction.oncomplete = () => {
done(db);
};
@ -49,9 +49,9 @@ let idbGenerator = async function () {
request.onsuccess = done;
});
let transaction = db.transaction(["obj1", "obj2"], "readwrite");
let store1 = transaction.objectStore("obj1");
let store2 = transaction.objectStore("obj2");
const transaction = db.transaction(["obj1", "obj2"], "readwrite");
const store1 = transaction.objectStore("obj1");
const store2 = transaction.objectStore("obj2");
store1.add({id: 1, name: "foo", email: "foo@bar.com"});
store1.add({id: 2, name: "foo2", email: "foo2@bar.com"});
store1.add({id: 3, name: "foo2", email: "foo3@bar.com"});
@ -69,10 +69,10 @@ let idbGenerator = async function () {
db.close();
request = indexedDB.open("idb2", 1);
let db2 = await new Promise(done => {
const db2 = await new Promise(done => {
request.onupgradeneeded = event => {
let db2 = event.target.result;
let store3 = db2.createObjectStore("obj3", { keyPath: "id3" });
const db2 = event.target.result;
const store3 = db2.createObjectStore("obj3", { keyPath: "id3" });
store3.createIndex("name2", "name2", { unique: true });
store3.transaction.oncomplete = () => {
done(db2);

View File

@ -28,18 +28,18 @@ localStorage.setItem("ls2", "foobar-2");
sessionStorage.setItem("ss1", "foobar-3");
console.log("added cookies and stuff from main page");
let idbGenerator = async function () {
const idbGenerator = async function () {
let request = indexedDB.open("idb1", 1);
request.onerror = function() {
throw new Error("error opening db connection");
};
let db = await new Promise(done => {
const db = await new Promise(done => {
request.onupgradeneeded = event => {
let db = event.target.result;
let store1 = db.createObjectStore("obj1", { keyPath: "id" });
const db = event.target.result;
const store1 = db.createObjectStore("obj1", { keyPath: "id" });
store1.createIndex("name", "name", { unique: false });
store1.createIndex("email", "email", { unique: true });
let store2 = db.createObjectStore("obj2", { keyPath: "id2" });
const store2 = db.createObjectStore("obj2", { keyPath: "id2" });
store1.transaction.oncomplete = () => {
done(db);
};
@ -51,9 +51,9 @@ let idbGenerator = async function () {
request.onsuccess = done;
});
let transaction = db.transaction(["obj1", "obj2"], "readwrite");
let store1 = transaction.objectStore("obj1");
let store2 = transaction.objectStore("obj2");
const transaction = db.transaction(["obj1", "obj2"], "readwrite");
const store1 = transaction.objectStore("obj1");
const store2 = transaction.objectStore("obj2");
store1.add({id: 1, name: "foo", email: "foo@bar.com"});
store1.add({id: 2, name: "foo2", email: "foo2@bar.com"});
store1.add({id: 3, name: "foo2", email: "foo3@bar.com"});
@ -71,10 +71,10 @@ let idbGenerator = async function () {
db.close();
request = indexedDB.open("idb2", 1);
let db2 = await new Promise(done => {
const db2 = await new Promise(done => {
request.onupgradeneeded = event => {
let db2 = event.target.result;
let store3 = db2.createObjectStore("obj3", { keyPath: "id3" });
const db2 = event.target.result;
const store3 = db2.createObjectStore("obj3", { keyPath: "id3" });
store3.createIndex("name2", "name2", { unique: true });
store3.transaction.oncomplete = () => {
done(db2);

View File

@ -13,15 +13,15 @@ document.cookie = "sc1=foobar;";
localStorage.setItem("iframe-s-ls1", "foobar");
sessionStorage.setItem("iframe-s-ss1", "foobar-2");
let idbGenerator = async function () {
const idbGenerator = async function () {
let request = indexedDB.open("idb-s1", 1);
request.onerror = function() {
throw new Error("error opening db connection");
};
let db = await new Promise(done => {
const db = await new Promise(done => {
request.onupgradeneeded = event => {
let db = event.target.result;
let store1 = db.createObjectStore("obj-s1", { keyPath: "id" });
const db = event.target.result;
const store1 = db.createObjectStore("obj-s1", { keyPath: "id" });
store1.transaction.oncomplete = () => {
done(db);
};
@ -32,7 +32,7 @@ let idbGenerator = async function () {
});
let transaction = db.transaction(["obj-s1"], "readwrite");
let store1 = transaction.objectStore("obj-s1");
const store1 = transaction.objectStore("obj-s1");
store1.add({id: 6, name: "foo", email: "foo@bar.com"});
store1.add({id: 7, name: "foo2", email: "foo2@bar.com"});
await new Promise(success => {
@ -42,10 +42,10 @@ let idbGenerator = async function () {
db.close();
request = indexedDB.open("idb-s2", 1);
let db2 = await new Promise(done => {
const db2 = await new Promise(done => {
request.onupgradeneeded = event => {
let db2 = event.target.result;
let store3 =
const db2 = event.target.result;
const store3 =
db2.createObjectStore("obj-s2", { keyPath: "id3", autoIncrement: true });
store3.createIndex("name2", "name2", { unique: true });
store3.transaction.oncomplete = () => {
@ -58,7 +58,7 @@ let idbGenerator = async function () {
});
transaction = db2.transaction(["obj-s2"], "readwrite");
let store3 = transaction.objectStore("obj-s2");
const store3 = transaction.objectStore("obj-s2");
store3.add({id3: 16, name2: "foo", email: "foo@bar.com"});
await new Promise(success => {
transaction.oncomplete = success;

View File

@ -37,8 +37,8 @@ window.clearLocalAndSessionStores = function() {
};
window.clearCookies = function() {
let cookies = document.cookie;
for (let cookie of cookies.split(";")) {
const cookies = document.cookie;
for (const cookie of cookies.split(";")) {
removeCookie(cookie.split("=")[0]);
}
};

View File

@ -13,7 +13,7 @@
<p>A test page with nested iframes</p>
<iframe></iframe>
<script type="application/javascript">
let iframe = document.querySelector("iframe");
const iframe = document.querySelector("iframe");
let i = parseInt(location.href.split("?")[1]) || 1;
// The frame can't have the same src URL as any of its ancestors.