Bug 1372427 - prevent using arguments.caller. r=mattn
MozReview-Commit-ID: J6NceWWJzbP
--- a/toolkit/components/satchel/.eslintrc.js
+++ b/toolkit/components/satchel/.eslintrc.js
@@ -67,10 +67,11 @@ module.exports = {
"no-proto": "error",
"no-unneeded-ternary": "error",
yoda: "error",
"no-new-wrappers": "error",
"no-unused-vars": ["error", {
args: "none",
varsIgnorePattern: "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$",
}],
+ "no-caller": "error",
},
};
--- a/toolkit/components/satchel/test/test_form_autocomplete.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete.html
@@ -1033,22 +1033,22 @@ function runTest() { // eslint-disable-l
}
function addEntry(name, value) {
updateFormHistory({ op: "add", fieldname: name, value }, runTest);
}
// Runs the next test when scroll event occurs
function waitForScroll() {
- addEventListener("scroll", function() {
+ addEventListener("scroll", function listener() {
if (!window.pageYOffset) {
return;
}
- removeEventListener("scroll", arguments.callee, false);
+ removeEventListener("scroll", listener, false);
setTimeout(runTest, 100);
}, false);
}
function waitForMenuChange(expectedCount, expectedFirstValue) {
notifyMenuChanged(expectedCount, expectedFirstValue, runTest);
}