From 7b4ec0f6cf0b596448996e1c70fcecaea5e4f57c Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Wed, 7 Sep 2016 18:44:17 -0700 Subject: [PATCH] Bug 1288558 - Enable eslint no-undef for shipping pwmgr code. r=me MozReview-Commit-ID: 5rbPmxODejr --HG-- extra : rebase_source : e4313608623e22d8bf15a7bd605a96be9a437d49 --- toolkit/components/passwordmgr/.eslintrc | 3 +++ toolkit/components/passwordmgr/content/passwordManager.js | 4 ++-- toolkit/components/passwordmgr/nsLoginManager.js | 2 +- toolkit/components/passwordmgr/nsLoginManagerPrompter.js | 2 +- toolkit/components/passwordmgr/test/.eslintrc | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/toolkit/components/passwordmgr/.eslintrc b/toolkit/components/passwordmgr/.eslintrc index 73bd7f81d379..fd49a0b7d53d 100644 --- a/toolkit/components/passwordmgr/.eslintrc +++ b/toolkit/components/passwordmgr/.eslintrc @@ -10,6 +10,9 @@ // Commas at the end of the line not the start "comma-style": 2, + // No using undeclared variables + "no-undef": 2, + // Don't allow unused local variables unless they match the pattern "no-unused-vars": [2, {"args": "none", "vars": "local", "varsIgnorePattern": "^(ids|ignored|unused)$"}], } diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index b2d86267b0c8..59a54deaf076 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -484,9 +484,9 @@ function HandleSignonKeyPress(e) { if (signonsTree.getAttribute("editing")) { return; } - if (e.keyCode == KeyEvent.DOM_VK_DELETE || + if (e.keyCode == KeyboardEvent.DOM_VK_DELETE || (AppConstants.platform == "macosx" && - e.keyCode == KeyEvent.DOM_VK_BACK_SPACE)) + e.keyCode == KeyboardEvent.DOM_VK_BACK_SPACE)) { DeleteSignon(); } diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js index 5b1decfd0c81..29304c4c6f91 100644 --- a/toolkit/components/passwordmgr/nsLoginManager.js +++ b/toolkit/components/passwordmgr/nsLoginManager.js @@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/AppConstants.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Timer.jsm"); -Cu.import("resource://gre/modules/LoginManagerContent.jsm"); +Cu.import("resource://gre/modules/LoginManagerContent.jsm"); /*global UserAutoCompleteResult */ XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js index a0e09131489f..622261461cd3 100644 --- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js +++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js @@ -7,7 +7,7 @@ const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); -Cu.import("resource://gre/modules/SharedPromptUtils.jsm"); +const { PromptUtils } = Cu.import("resource://gre/modules/SharedPromptUtils.jsm", {}); XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper", "resource://gre/modules/LoginHelper.jsm"); diff --git a/toolkit/components/passwordmgr/test/.eslintrc b/toolkit/components/passwordmgr/test/.eslintrc index c48874775b17..e116c5d14a1f 100644 --- a/toolkit/components/passwordmgr/test/.eslintrc +++ b/toolkit/components/passwordmgr/test/.eslintrc @@ -4,6 +4,7 @@ "../../../../testing/mochitest/chrome.eslintrc" ], "rules": { + "no-undef": 0, "no-unused-vars": 0, }, }