Bug 1251916 - Use standard JavaScript features in toolkit/components/passwordmgr to pass eslint checks: ignore statements which eslint regards as native reassignments. r?MattN draft
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 28 Feb 2016 11:20:00 +0100
changeset 335276 dbd91f00ec89519f5a8258b88dadca8baeb67e97
parent 335275 ac87a738b36b7f11af00533ce92065045aa66b99
child 335277 1a7b84d4a43dbe5e6cdd44e43510d4b1d4f16519
push id11752
push userarchaeopteryx@coole-files.de
push dateSun, 28 Feb 2016 10:20:35 +0000
reviewersMattN
bugs1251916
milestone47.0a1
Bug 1251916 - Use standard JavaScript features in toolkit/components/passwordmgr to pass eslint checks: ignore statements which eslint regards as native reassignments. r?MattN It treats Assert, is and ok as natives. eslint rule: http://eslint.org/docs/rules/no-native-reassign MozReview-Commit-ID: JzwQ37Y97jJ
toolkit/components/passwordmgr/test/LoginTestUtils.jsm
toolkit/components/passwordmgr/test/pwmgr_common.js
--- a/toolkit/components/passwordmgr/test/LoginTestUtils.jsm
+++ b/toolkit/components/passwordmgr/test/LoginTestUtils.jsm
@@ -24,17 +24,17 @@ const LoginInfo =
       Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
                              "nsILoginInfo", "init");
 
 // For now, we need consumers to provide a reference to Assert.jsm.
 var Assert = null;
 
 this.LoginTestUtils = {
   set Assert(assert) {
-    Assert = assert;
+    Assert = assert; // eslint-disable-line no-native-reassign
   },
 
   /**
    * Forces the storage module to save all data, and the Login Manager service
    * to replace the storage module with a newly initialized instance.
    */
   * reloadData() {
     Services.obs.notifyObservers(null, "passwordmgr-storage-replace", null);
--- a/toolkit/components/passwordmgr/test/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/pwmgr_common.js
@@ -284,17 +284,17 @@ function promiseFormsProcessed(expectedC
 }
 
 // Code to run when loaded as a chrome script in tests via loadChromeScript
 if (this.addMessageListener) {
   const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
   var SpecialPowers = { Cc, Ci, Cr, Cu, };
   var ok, is;
   // Ignore ok/is in commonInit since they aren't defined in a chrome script.
-  ok = is = () => {};
+  ok = is = () => {}; // eslint-disable-line no-native-reassign
 
   Cu.import("resource://gre/modules/Task.jsm");
 
   addMessageListener("setupParent", () => {
     commonInit(true);
     sendAsyncMessage("doneSetup");
   });