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
--- 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");
});