Bug 1372427 - prevent using arguments.caller. r=mattn draft
authorJonathan Guillotte-Blouin <jguillotteblouin@mozilla.com>
Fri, 16 Jun 2017 14:55:06 -0700
changeset 597802 4d524379de87cf943ec035ae11506a9510e66a38
parent 597801 9f7e43bc2bfaaddc3872083a6b23f831070d2858
child 597803 beca1e626ba5e51cffaa385a3f38acea3011f05d
push id65027
push userbmo:jguillotteblouin@mozilla.com
push dateTue, 20 Jun 2017 23:30:25 +0000
reviewersmattn
bugs1372427
milestone56.0a1
Bug 1372427 - prevent using arguments.caller. r=mattn MozReview-Commit-ID: J6NceWWJzbP
toolkit/components/satchel/.eslintrc.js
toolkit/components/satchel/test/test_form_autocomplete.html
--- 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);
 }