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

Depends on D57223

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Marco Vega 2020-02-03 11:31:33 +00:00
parent 8a787e9be0
commit 23e7aaa178
33 changed files with 270 additions and 258 deletions

View File

@ -56,14 +56,8 @@ browser/locales/
# Generated data files
browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.jsm
# devtools/ exclusions
devtools/client/inspector/markup/test/doc_markup_events_*.html
devtools/client/performance/components/test/test_jit_optimizations_01.html
devtools/server/tests/browser/storage-*.html
!devtools/server/tests/browser/storage-unsecured-iframe.html
devtools/server/tests/browser/stylesheets-nested-iframes.html
devtools/client/webreplay/mochitest/examples/*.html
devtools/client/webreplay/mochitest/examples/
# Soon to be removed (bug 1609815)
devtools/client/webreplay/
# Ignore devtools debugger files which aren't intended for linting, and also
# aren't included in any .eslintignore or .prettierignore file.

View File

@ -11,7 +11,7 @@ const TEST_URL = URL_ROOT + "doc_markup_events_01.html";
loadHelperScript("helper_events_test_runner.js");
const TEST_DATA = [ // eslint-disable-line
const TEST_DATA = [
{
selector: "html",
expected: [
@ -28,12 +28,12 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "mouseover",
filename: TEST_URL + ":45:31",
filename: TEST_URL + ":48:31",
attributes: ["Capturing", "DOM2"],
handler:
"function mouseoverHandler(event) {\n" +
' if (event.target.id !== "container") {\n' +
' let output = document.getElementById("output");\n' +
' const output = document.getElementById("output");\n' +
" output.textContent = event.target.textContent;\n" +
" }\n" +
"}",
@ -45,21 +45,21 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":52:27",
filename: TEST_URL + ":55:27",
attributes: ["Bubbling", "DOM2"],
handler:
"function clickHandler(event) {\n" +
' let output = document.getElementById("output");\n' +
' const output = document.getElementById("output");\n' +
' output.textContent = "click";\n' +
"}",
},
{
type: "mouseup",
filename: TEST_URL + ":57:29",
filename: TEST_URL + ":60:29",
attributes: ["Bubbling", "DOM2"],
handler:
"function mouseupHandler(event) {\n" +
' let output = document.getElementById("output");\n' +
' const output = document.getElementById("output");\n' +
' output.textContent = "mouseup";\n' +
"}",
},
@ -81,7 +81,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":72:35",
filename: TEST_URL + ":75:35",
attributes: ["Bubbling", "DOM2"],
handler:
"function noeventsClickHandler(event) {\n" +
@ -117,7 +117,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":67:29",
filename: TEST_URL + ":70:29",
attributes: ["Bubbling", "DOM2"],
handler: "function(blah) {\n" + ' alert("handleEvent");\n' + "}",
},

View File

@ -11,25 +11,25 @@ const TEST_URL = URL_ROOT + "doc_markup_events_02.html";
loadHelperScript("helper_events_test_runner.js");
const TEST_DATA = [ // eslint-disable-line
const TEST_DATA = [
{
selector: "#fatarrow",
expected: [
{
type: "click",
filename: TEST_URL + ":39:43",
filename: TEST_URL + ":42:43",
attributes: ["Bubbling", "DOM2"],
handler: "() => {\n" + ' alert("Fat arrow without params!");\n' + "}",
},
{
type: "click",
filename: TEST_URL + ":43:43",
filename: TEST_URL + ":46:43",
attributes: ["Bubbling", "DOM2"],
handler: "event => {\n" + ' alert("Fat arrow with 1 param!");\n' + "}",
},
{
type: "click",
filename: TEST_URL + ":47:43",
filename: TEST_URL + ":50:43",
attributes: ["Bubbling", "DOM2"],
handler:
"(event, foo, bar) => {\n" +
@ -38,7 +38,7 @@ const TEST_DATA = [ // eslint-disable-line
},
{
type: "click",
filename: TEST_URL + ":51:43",
filename: TEST_URL + ":54:43",
attributes: ["Bubbling", "DOM2"],
handler: "b => b",
},
@ -49,7 +49,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":62:32",
filename: TEST_URL + ":65:32",
attributes: ["Bubbling", "DOM2"],
handler: "function(event) {\n" + ' alert("Bound event");\n' + "}",
},
@ -60,7 +60,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":85:29",
filename: TEST_URL + ":88:29",
attributes: ["Bubbling", "DOM2"],
handler: "function() {\n" + ' alert("boundHandleEvent");\n' + "}",
},
@ -71,7 +71,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":91:47",
filename: TEST_URL + ":94:47",
attributes: ["Bubbling", "DOM2"],
handler:
"function functionProceededByInlineComment() {\n" +
@ -85,7 +85,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":96:50",
filename: TEST_URL + ":99:50",
attributes: ["Bubbling", "DOM2"],
handler:
"function functionProceededByStreamingComment() {\n" +
@ -99,7 +99,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":71:34",
filename: TEST_URL + ":74:34",
attributes: ["Bubbling", "DOM2"],
handler: "function() {\n" + ' alert("obj.anonObjectMethod");\n' + "}",
},
@ -110,7 +110,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":75:34",
filename: TEST_URL + ":78:34",
attributes: ["Bubbling", "DOM2"],
handler: "function kay() {\n" + ' alert("obj.objectMethod");\n' + "}",
},

View File

@ -11,13 +11,13 @@ const TEST_URL = URL_ROOT + "doc_markup_events_03.html";
loadHelperScript("helper_events_test_runner.js");
const TEST_DATA = [ // eslint-disable-line
const TEST_DATA = [
{
selector: "#es6-method",
expected: [
{
type: "click",
filename: TEST_URL + ":66:17",
filename: TEST_URL + ":69:17",
attributes: ["Bubbling", "DOM2"],
handler:
"es6Method(foo, bar) {\n" + ' alert("obj.es6Method");\n' + "}",
@ -29,7 +29,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":85:25",
filename: TEST_URL + ":88:25",
attributes: ["Bubbling", "DOM2"],
handler: "function* generator() {\n" + ' alert("generator");\n' + "}",
},
@ -40,7 +40,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":43:58",
filename: TEST_URL + ":46:58",
attributes: ["Bubbling", "DOM2"],
handler: "function*() {\n" + ' alert("anonGenerator");\n' + "}",
},
@ -51,7 +51,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":20:18",
filename: TEST_URL + ":22:18",
attributes: ["Bubbling", "DOM2"],
handler:
"function foo() {\n" + ' alert("namedFunctionExpression");\n' + "}",
@ -63,7 +63,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":24:43",
filename: TEST_URL + ":26:45",
attributes: ["Bubbling", "DOM2"],
handler:
"function() {\n" + ' alert("anonFunctionExpression");\n' + "}",
@ -75,7 +75,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":29:27",
filename: TEST_URL + ":31:27",
attributes: ["Bubbling", "DOM2"],
handler: "function bar() {\n" + ' alert("returnedFunction");\n' + "}",
},

View File

@ -11,13 +11,13 @@ const TEST_URL = URL_ROOT + "doc_markup_events_04.html";
loadHelperScript("helper_events_test_runner.js");
const TEST_DATA = [ // eslint-disable-line
const TEST_DATA = [
{
selector: "html",
expected: [
{
type: "click",
filename: TEST_URL + ":56:67",
filename: TEST_URL + ":59:67",
attributes: ["Bubbling", "DOM2"],
handler:
"function(foo2, bar2) {\n" +
@ -26,7 +26,7 @@ const TEST_DATA = [ // eslint-disable-line
},
{
type: "click",
filename: TEST_URL + ":52:51",
filename: TEST_URL + ":55:51",
attributes: ["Bubbling", "DOM2"],
handler:
"function(foo, bar) {\n" +
@ -71,7 +71,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":24:57",
filename: TEST_URL + ":26:47",
attributes: ["Bubbling", "DOM2"],
handler:
"function multi() {\n" + ' alert("multipleAssignment");\n' + "}",
@ -105,7 +105,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":77:29",
filename: TEST_URL + ":80:29",
attributes: ["Bubbling", "DOM2"],
handler:
"function(event) {\n" +

View File

@ -44,41 +44,41 @@ const TEST_DATA = [
},
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -98,7 +98,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -142,7 +142,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -153,7 +153,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -195,7 +195,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],

View File

@ -18,41 +18,41 @@ const TEST_DATA = [
expected: [
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -72,7 +72,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -126,7 +126,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -137,7 +137,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -189,7 +189,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],

View File

@ -18,41 +18,41 @@ const TEST_DATA = [
expected: [
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -72,7 +72,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -86,7 +86,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -97,7 +97,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -108,7 +108,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],
@ -125,7 +125,7 @@ const TEST_DATA = [
expected: [
{
type: "dragend",
filename: TEST_URL + ":31:46",
filename: TEST_URL + ":33:48",
attributes: [
"jQuery",
"Live"
@ -137,7 +137,7 @@ const TEST_DATA = [
},
{
type: "dragleave",
filename: TEST_URL + ":30:48",
filename: TEST_URL + ":32:50",
attributes: [
"jQuery",
"Live"
@ -149,7 +149,7 @@ const TEST_DATA = [
},
{
type: "dragover",
filename: TEST_URL + ":33:47",
filename: TEST_URL + ":35:49",
attributes: [
"jQuery",
"Live"
@ -161,7 +161,7 @@ const TEST_DATA = [
},
{
type: "drop",
filename: TEST_URL + ":32:43",
filename: TEST_URL + ":34:45",
attributes: [
"jQuery",
"Live"

View File

@ -18,41 +18,41 @@ const TEST_DATA = [
expected: [
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -72,7 +72,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -85,7 +85,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -96,7 +96,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -122,7 +122,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],

View File

@ -31,41 +31,41 @@ const TEST_DATA = [
},
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -85,7 +85,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -98,7 +98,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -109,7 +109,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -120,7 +120,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],
@ -136,7 +136,7 @@ const TEST_DATA = [
expected: [
{
type: "dblclick",
filename: TEST_URL + ":28:47",
filename: TEST_URL + ":30:49",
attributes: [
"jQuery",
"Live"
@ -148,7 +148,7 @@ const TEST_DATA = [
},
{
type: "dragstart",
filename: TEST_URL + ":29:48",
filename: TEST_URL + ":31:50",
attributes: [
"jQuery",
"Live"

View File

@ -31,41 +31,41 @@ const TEST_DATA = [
},
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -85,7 +85,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -118,7 +118,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -129,7 +129,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -140,7 +140,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],
@ -156,7 +156,7 @@ const TEST_DATA = [
expected: [
{
type: "dblclick",
filename: TEST_URL + ":28:47",
filename: TEST_URL + ":30:49",
attributes: [
"jQuery",
"Live"
@ -180,7 +180,7 @@ const TEST_DATA = [
},
{
type: "dragstart",
filename: TEST_URL + ":29:48",
filename: TEST_URL + ":31:50",
attributes: [
"jQuery",
"Live"

View File

@ -32,41 +32,41 @@ const TEST_DATA = [
},
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -86,7 +86,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -116,7 +116,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -127,7 +127,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -138,7 +138,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],
@ -154,7 +154,7 @@ const TEST_DATA = [
expected: [
{
type: "dblclick",
filename: TEST_URL + ":28:47",
filename: TEST_URL + ":30:49",
attributes: [
"jQuery",
"Live"
@ -211,7 +211,7 @@ const TEST_DATA = [
},
{
type: "dragend",
filename: TEST_URL + ":31:46",
filename: TEST_URL + ":33:48",
attributes: [
"jQuery",
"Live"
@ -268,7 +268,7 @@ const TEST_DATA = [
},
{
type: "dragleave",
filename: TEST_URL + ":30:48",
filename: TEST_URL + ":32:50",
attributes: [
"jQuery",
"Live"
@ -325,7 +325,7 @@ const TEST_DATA = [
},
{
type: "dragstart",
filename: TEST_URL + ":29:48",
filename: TEST_URL + ":31:50",
attributes: [
"jQuery",
"Live"

View File

@ -32,41 +32,41 @@ const TEST_DATA = [
},
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -86,7 +86,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -116,7 +116,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -127,7 +127,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -138,7 +138,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],
@ -154,7 +154,7 @@ const TEST_DATA = [
expected: [
{
type: "dblclick",
filename: TEST_URL + ":28:47",
filename: TEST_URL + ":30:49",
attributes: [
"jQuery",
"Live"
@ -166,7 +166,7 @@ const TEST_DATA = [
},
{
type: "dragend",
filename: TEST_URL + ":31:46",
filename: TEST_URL + ":33:48",
attributes: [
"jQuery",
"Live"
@ -178,7 +178,7 @@ const TEST_DATA = [
},
{
type: "dragleave",
filename: TEST_URL + ":30:48",
filename: TEST_URL + ":32:50",
attributes: [
"jQuery",
"Live"
@ -190,7 +190,7 @@ const TEST_DATA = [
},
{
type: "dragover",
filename: TEST_URL + ":33:47",
filename: TEST_URL + ":35:49",
attributes: [
"jQuery",
"Live"
@ -202,7 +202,7 @@ const TEST_DATA = [
},
{
type: "dragstart",
filename: TEST_URL + ":29:48",
filename: TEST_URL + ":31:50",
attributes: [
"jQuery",
"Live"
@ -214,7 +214,7 @@ const TEST_DATA = [
},
{
type: "drop",
filename: TEST_URL + ":32:43",
filename: TEST_URL + ":34:45",
attributes: [
"jQuery",
"Live"

View File

@ -20,41 +20,41 @@ const TEST_DATA = [
expected: [
{
type: "load",
filename: TEST_URL + ":27:38",
filename: TEST_URL + ":29:38",
attributes: [
"Bubbling",
"DOM2"
],
handler: `
() => {
var handler1 = function liveDivDblClick() {
const handler1 = function liveDivDblClick() {
alert(1);
};
var handler2 = function liveDivDragStart() {
const handler2 = function liveDivDragStart() {
alert(2);
};
var handler3 = function liveDivDragLeave() {
const handler3 = function liveDivDragLeave() {
alert(3);
};
var handler4 = function liveDivDragEnd() {
const handler4 = function liveDivDragEnd() {
alert(4);
};
var handler5 = function liveDivDrop() {
const handler5 = function liveDivDrop() {
alert(5);
};
var handler6 = function liveDivDragOver() {
const handler6 = function liveDivDragOver() {
alert(6);
};
var handler7 = function divClick1() {
const handler7 = function divClick1() {
alert(7);
};
var handler8 = function divClick2() {
const handler8 = function divClick2() {
alert(8);
};
var handler9 = function divKeyDown() {
const handler9 = function divKeyDown() {
alert(9);
};
var handler10 = function divDragOut() {
const handler10 = function divDragOut() {
alert(10);
};
@ -74,7 +74,7 @@ const TEST_DATA = [
$(document).on("dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);
@ -87,7 +87,7 @@ const TEST_DATA = [
expected: [
{
type: "click",
filename: TEST_URL + ":34:41",
filename: TEST_URL + ":36:43",
attributes: [
"jQuery"
],
@ -98,7 +98,7 @@ const TEST_DATA = [
},
{
type: "click",
filename: TEST_URL + ":35:41",
filename: TEST_URL + ":37:43",
attributes: [
"jQuery"
],
@ -109,7 +109,7 @@ const TEST_DATA = [
},
{
type: "keydown",
filename: TEST_URL + ":36:42",
filename: TEST_URL + ":38:44",
attributes: [
"jQuery"
],
@ -125,7 +125,7 @@ const TEST_DATA = [
expected: [
{
type: "dragend",
filename: TEST_URL + ":31:46",
filename: TEST_URL + ":33:48",
attributes: [
"jQuery",
"Live"
@ -137,7 +137,7 @@ const TEST_DATA = [
},
{
type: "dragleave",
filename: TEST_URL + ":30:48",
filename: TEST_URL + ":32:50",
attributes: [
"jQuery",
"Live"
@ -149,7 +149,7 @@ const TEST_DATA = [
},
{
type: "dragover",
filename: TEST_URL + ":33:47",
filename: TEST_URL + ":35:49",
attributes: [
"jQuery",
"Live"
@ -161,7 +161,7 @@ const TEST_DATA = [
},
{
type: "drop",
filename: TEST_URL + ":32:43",
filename: TEST_URL + ":34:45",
attributes: [
"jQuery",
"Live"

View File

@ -18,7 +18,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":17:23",
filename: TEST_URL + ":20:23",
attributes: ["Bubbling", "DOM2"],
handler: `() => {\n` + ` console.log("handleEvent");\n` + `}`,
},
@ -29,7 +29,7 @@ const TEST_DATA = [ // eslint-disable-line
expected: [
{
type: "click",
filename: TEST_URL + ":24:23",
filename: TEST_URL + ":27:23",
attributes: ["Bubbling", "DOM2"],
handler: `() => {\n` + ` console.log("handleEvent");\n` + `}`,
},

View File

@ -29,6 +29,9 @@
}
</style>
<script type="application/javascript">
"use strict";
/* exported init */
function init() {
const container = document.getElementById("container");
const multiple = document.getElementById("multiple");
@ -37,7 +40,7 @@
multiple.addEventListener("click", clickHandler);
multiple.addEventListener("mouseup", mouseupHandler);
const he = new handleEventClick();
const he = new HandleEventClick();
const handleevent = document.getElementById("handleevent");
handleevent.addEventListener("click", he);
}
@ -59,11 +62,11 @@
output.textContent = "mouseup";
}
function handleEventClick(hehe) {
function HandleEventClick(hehe) {
}
handleEventClick.prototype = {
HandleEventClick.prototype = {
handleEvent: function(blah) {
alert("handleEvent");
}
@ -73,6 +76,7 @@
alert("noevents has an event listener");
}
/* exported addNoeventsClickHandler, removeNoeventsClickHandler */
function addNoeventsClickHandler() {
const noevents = document.getElementById("noevents");
noevents.addEventListener("click", noeventsClickHandler);

View File

@ -17,24 +17,27 @@
}
</style>
<script type="application/javascript">
"use strict";
/* exported init */
function init() {
const fatarrow = document.getElementById("fatarrow");
const he = new handleEventClick();
const he = new HandleEventClick();
const anonObjectMethod = document.getElementById("anon-object-method");
anonObjectMethod.addEventListener("click", he.anonObjectMethod);
const objectMethod = document.getElementById("object-method");
objectMethod.addEventListener("click", he.objectMethod);
const bhe = new boundHandleEventClick();
const bhe = new BoundHandleEventClick();
const boundheNode = document.getElementById("boundhe");
bhe.handleEvent = bhe.handleEvent.bind(bhe);
boundheNode.addEventListener("click", bhe);
const boundNode = document.getElementById("bound");
boundClickHandler = boundClickHandler.bind(this);
boundNode.addEventListener("click", boundClickHandler);
BoundClickHandler = BoundClickHandler.bind(this);
boundNode.addEventListener("click", BoundClickHandler);
fatarrow.addEventListener("click", () => {
alert("Fat arrow without params!");
@ -59,15 +62,15 @@
.addEventListener("click", functionProceededByStreamingComment);
}
function boundClickHandler(event) {
function BoundClickHandler(event) {
alert("Bound event");
}
function handleEventClick(hehe) {
function HandleEventClick(hehe) {
}
handleEventClick.prototype = {
HandleEventClick.prototype = {
anonObjectMethod: function() {
alert("obj.anonObjectMethod");
},
@ -77,11 +80,11 @@
},
};
function boundHandleEventClick() {
function BoundHandleEventClick() {
}
boundHandleEventClick.prototype = {
BoundHandleEventClick.prototype = {
handleEvent: function() {
alert("boundHandleEvent");
}

View File

@ -16,6 +16,8 @@
}
</style>
<script type="application/javascript">
"use strict";
const namedFunctionExpression =
function foo() {
alert("namedFunctionExpression");
@ -31,6 +33,7 @@
}
})();
/* exported init */
function init() {
const em = new Es6Method();
const es6Method = document.getElementById("es6-method");

View File

@ -16,15 +16,18 @@
}
</style>
<script type="application/javascript">
"use strict";
const constructedFunc = new Function();
const constructedFuncWithBodyString =
new Function('a', 'b', 'c', 'alert("constructedFuncWithBodyString");');
const multipleAssignment = foo = bar = function multi() {
const multipleAssignment = function multi() {
alert("multipleAssignment");
}
/* exported init */
function init() {
const constructedFunctionNode =
document.getElementById("constructed-function");
@ -81,10 +84,6 @@
}
}
};
function* generator() {
alert("generator");
}
</script>
</head>
<body onload="init();">

View File

@ -16,6 +16,8 @@
</style>
<script type="application/javascript">
"use strict";
const jq = document.location.search.substr(1);
const script = document.createElement("script");
@ -25,16 +27,16 @@
document.head.appendChild(script);
window.addEventListener("load", () => {
var handler1 = function liveDivDblClick() { alert(1); };
var handler2 = function liveDivDragStart() { alert(2); };
var handler3 = function liveDivDragLeave() { alert(3); };
var handler4 = function liveDivDragEnd() { alert(4); };
var handler5 = function liveDivDrop() { alert(5); };
var handler6 = function liveDivDragOver() { alert(6); };
var handler7 = function divClick1() { alert(7); };
var handler8 = function divClick2() { alert(8); };
var handler9 = function divKeyDown() { alert(9); };
var handler10 = function divDragOut() { alert(10); };
const handler1 = function liveDivDblClick() { alert(1); };
const handler2 = function liveDivDragStart() { alert(2); };
const handler3 = function liveDivDragLeave() { alert(3); };
const handler4 = function liveDivDragEnd() { alert(4); };
const handler5 = function liveDivDrop() { alert(5); };
const handler6 = function liveDivDragOver() { alert(6); };
const handler7 = function divClick1() { alert(7); };
const handler8 = function divClick2() { alert(8); };
const handler9 = function divKeyDown() { alert(9); };
const handler10 = function divDragOut() { alert(10); };
if ($("#livediv").live) {
$("#livediv").live( "dblclick", handler1);
@ -52,7 +54,7 @@
$(document).on( "dragout", "#livediv:xxxxx", handler10);
}
var div = $("div")[0];
const div = $("div")[0];
$(div).click(handler7);
$(div).click(handler8);
$(div).keydown(handler9);

View File

@ -8,6 +8,9 @@
}
</style>
<script>
"use strict";
/* exported init */
function init() {
const valid = document.querySelector("#valid-object-listener");
const validInvalid = document.querySelector("#valid-invalid-object-listeners");

View File

@ -22,7 +22,7 @@
alert("inlineFunction");
},
render: function () {
render() {
return React.createElement(
"div",
null,

View File

@ -24,7 +24,7 @@
alert("inlineFunction");
},
render: function () {
render() {
return (
<div>
<h3 id="inlinejsx" onClick={this.inlineFunction}>Click for inlineFunction</h3>

View File

@ -22,7 +22,7 @@
alert("inlineFunction");
},
render: function () {
render() {
return React.createElement(
"div",
null,

View File

@ -24,7 +24,7 @@
alert("inlineFunction");
},
render: function () {
render() {
return (
<div>
<h3 id="inlinejsx" onClick={this.inlineFunction}>Click for inlineFunction</h3>

View File

@ -19,6 +19,7 @@ let { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/performance/",
window,
});
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
const $ = (selector, scope = document) => scope.querySelector(selector);
const $$ = (selector, scope = document) => scope.querySelectorAll(selector);

View File

@ -13,15 +13,15 @@ Test the rendering of the JIT Optimizations tree. Tests when jit data has observ
<pre id="test">
<script src="head.js" type="application/javascript"></script>
<script type="application/javascript">
"use strict";
window.onload = async function () {
try {
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;
opts = ReactDOM.render(JITOptimizations({
const opts = ReactDOM.render(JITOptimizations({
onViewSourceInDebugger: function(){},
frameData: {
isMetaCategory: false,

View File

@ -7,6 +7,7 @@
<body onload="createCookies()">
<script type="application/javascript">
"use strict";
// eslint-disable-next-line no-unused-vars
function createCookies() {
document.cookie = "name=value1;path=/;";
document.cookie = "name=value2;path=/path2/;";
@ -20,7 +21,7 @@ window.removeCookie = function (name) {
window.clearCookies = function () {
const cookies = document.cookie;
for (const cookie of cookies.split(";")) {
removeCookie(cookie.split("=")[0]);
window.removeCookie(cookie.split("=")[0]);
}
};
</script>

View File

@ -33,13 +33,13 @@ const idbGenerator = async function () {
};
const db = await new Promise(done => {
request.onupgradeneeded = event => {
const db = event.target.result;
const store1 = db.createObjectStore("obj1", { keyPath: "id" });
const dbResult = event.target.result;
const store1 = dbResult.createObjectStore("obj1", { keyPath: "id" });
store1.createIndex("name", "name", { unique: false });
store1.createIndex("email", "email", { unique: true });
const store2 = db.createObjectStore("obj2", { keyPath: "id2" });
dbResult.createObjectStore("obj2", { keyPath: "id2" });
store1.transaction.oncomplete = () => {
done(db);
done(dbResult);
};
};
});
@ -71,11 +71,11 @@ const idbGenerator = async function () {
request = indexedDB.open("idb2", 1);
const db2 = await new Promise(done => {
request.onupgradeneeded = event => {
const db2 = event.target.result;
const store3 = db2.createObjectStore("obj3", { keyPath: "id3" });
const db2Result = event.target.result;
const store3 = db2Result.createObjectStore("obj3", { keyPath: "id3" });
store3.createIndex("name2", "name2", { unique: true });
store3.transaction.oncomplete = () => {
done(db2);
done(db2Result);
}
};
});

View File

@ -35,13 +35,13 @@ const idbGenerator = async function () {
};
const db = await new Promise(done => {
request.onupgradeneeded = event => {
const db = event.target.result;
const store1 = db.createObjectStore("obj1", { keyPath: "id" });
const dbResult = event.target.result;
const store1 = dbResult.createObjectStore("obj1", { keyPath: "id" });
store1.createIndex("name", "name", { unique: false });
store1.createIndex("email", "email", { unique: true });
const store2 = db.createObjectStore("obj2", { keyPath: "id2" });
dbResult.createObjectStore("obj2", { keyPath: "id2" });
store1.transaction.oncomplete = () => {
done(db);
done(dbResult);
};
};
});
@ -73,11 +73,11 @@ const idbGenerator = async function () {
request = indexedDB.open("idb2", 1);
const db2 = await new Promise(done => {
request.onupgradeneeded = event => {
const db2 = event.target.result;
const store3 = db2.createObjectStore("obj3", { keyPath: "id3" });
const db2Result = event.target.result;
const store3 = db2Result.createObjectStore("obj3", { keyPath: "id3" });
store3.createIndex("name2", "name2", { unique: true });
store3.transaction.oncomplete = () => {
done(db2);
done(db2Result);
}
};
});

View File

@ -8,7 +8,7 @@ Iframe for testing multiple host detetion in storage actor
</head>
<body>
<script type="application/javascript">
"use strict";
document.cookie = "sc1=foobar;";
localStorage.setItem("iframe-s-ls1", "foobar");
sessionStorage.setItem("iframe-s-ss1", "foobar-2");
@ -20,10 +20,10 @@ const idbGenerator = async function () {
};
const db = await new Promise(done => {
request.onupgradeneeded = event => {
const db = event.target.result;
const store1 = db.createObjectStore("obj-s1", { keyPath: "id" });
const dbResult = event.target.result;
const store1 = dbResult.createObjectStore("obj-s1", { keyPath: "id" });
store1.transaction.oncomplete = () => {
done(db);
done(dbResult);
};
};
});
@ -44,12 +44,12 @@ const idbGenerator = async function () {
request = indexedDB.open("idb-s2", 1);
const db2 = await new Promise(done => {
request.onupgradeneeded = event => {
const db2 = event.target.result;
const db2Result = event.target.result;
const store3 =
db2.createObjectStore("obj-s2", { keyPath: "id3", autoIncrement: true });
db2Result.createObjectStore("obj-s2", { keyPath: "id3", autoIncrement: true });
store3.createIndex("name2", "name2", { unique: true });
store3.transaction.oncomplete = () => {
done(db2);
done(db2Result);
};
};
});

View File

@ -39,7 +39,7 @@ window.clearLocalAndSessionStores = function() {
window.clearCookies = function() {
const cookies = document.cookie;
for (const cookie of cookies.split(";")) {
removeCookie(cookie.split("=")[0]);
window.removeCookie(cookie.split("=")[0]);
}
};
</script>

View File

@ -13,8 +13,10 @@
<p>A test page with nested iframes</p>
<iframe></iframe>
<script type="application/javascript">
"use strict";
const iframe = document.querySelector("iframe");
let i = parseInt(location.href.split("?")[1]) || 1;
let i = parseInt(location.href.split("?")[1], 10) || 1;
// The frame can't have the same src URL as any of its ancestors.
// This will not infinitely recurse because a frame won't get a content