From 8d235f8e45b6b09b5e7cbefd5b37417919425c71 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 30 Jul 2018 10:27:36 +0100 Subject: [PATCH] Bug 1478305 - Remove unnecessary imports and fix ESLint warnings about unused variables for browser/. r=jaws MozReview-Commit-ID: 1vHR6ixePkN --HG-- extra : rebase_source : 8f9a322d1ff075ab56b81f8710df5d841839865b --- browser/components/migration/tests/unit/head_migration.js | 4 ---- .../payments/content/paymentDialogFrameScript.js | 1 - browser/extensions/formautofill/bootstrap.js | 3 ++- browser/extensions/formautofill/content/editDialog.js | 1 + browser/extensions/formautofill/content/manageDialog.js | 1 - browser/extensions/formautofill/test/unit/head.js | 7 ------- .../test/unit/test_profileAutocompleteResult.js | 1 + browser/extensions/pdfjs/content/PdfJsRegistration.jsm | 2 -- 8 files changed, 4 insertions(+), 16 deletions(-) diff --git a/browser/components/migration/tests/unit/head_migration.js b/browser/components/migration/tests/unit/head_migration.js index df185a93356d..ef341a7149f8 100644 --- a/browser/components/migration/tests/unit/head_migration.js +++ b/browser/components/migration/tests/unit/head_migration.js @@ -1,7 +1,5 @@ "use strict"; -/* exported gProfD, promiseMigration, registerFakePath, URL */ - ChromeUtils.import("resource:///modules/MigrationUtils.jsm"); ChromeUtils.import("resource://gre/modules/LoginHelper.jsm"); ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); @@ -15,10 +13,8 @@ ChromeUtils.import("resource://testing-common/PlacesTestUtils.jsm"); XPCOMUtils.defineLazyGlobalGetters(this, [ "URL" ]); -// eslint-disable-next-line no-unused-vars ChromeUtils.defineModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm"); -// eslint-disable-next-line no-unused-vars ChromeUtils.defineModuleGetter(this, "Sqlite", "resource://gre/modules/Sqlite.jsm"); diff --git a/browser/components/payments/content/paymentDialogFrameScript.js b/browser/components/payments/content/paymentDialogFrameScript.js index eda0dae598df..bae8c79f714b 100644 --- a/browser/components/payments/content/paymentDialogFrameScript.js +++ b/browser/components/payments/content/paymentDialogFrameScript.js @@ -19,7 +19,6 @@ /* eslint-env mozilla/frame-script */ -ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.defineModuleGetter(this, "FormAutofill", diff --git a/browser/extensions/formautofill/bootstrap.js b/browser/extensions/formautofill/bootstrap.js index b76e22c6a1fa..6d402572b678 100644 --- a/browser/extensions/formautofill/bootstrap.js +++ b/browser/extensions/formautofill/bootstrap.js @@ -126,10 +126,11 @@ function startup(data) { Services.mm.addMessageListener("FormAutoComplete:MaybeOpenPopup", onMaybeOpenPopup); formAutofillParent.init().catch(Cu.reportError); - /* exported FormAutofillContent */ + /* eslint-disable no-unused-vars */ Services.ppmm.loadProcessScript("data:,new " + function() { ChromeUtils.import("resource://formautofill/FormAutofillContent.jsm"); }, true); + /* eslint-enable no-unused-vars */ Services.mm.loadFrameScript("chrome://formautofill/content/FormAutofillFrameScript.js", true); } diff --git a/browser/extensions/formautofill/content/editDialog.js b/browser/extensions/formautofill/content/editDialog.js index fe5c7ccf9f3c..6e176a8341e7 100644 --- a/browser/extensions/formautofill/content/editDialog.js +++ b/browser/extensions/formautofill/content/editDialog.js @@ -7,6 +7,7 @@ "use strict"; +// eslint-disable-next-line no-unused-vars ChromeUtils.import("resource://formautofill/FormAutofill.jsm"); ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm"); diff --git a/browser/extensions/formautofill/content/manageDialog.js b/browser/extensions/formautofill/content/manageDialog.js index 3a5f216f4593..11044c8a3ea9 100644 --- a/browser/extensions/formautofill/content/manageDialog.js +++ b/browser/extensions/formautofill/content/manageDialog.js @@ -10,7 +10,6 @@ const EDIT_ADDRESS_URL = "chrome://formautofill/content/editAddress.xhtml"; const EDIT_CREDIT_CARD_URL = "chrome://formautofill/content/editCreditCard.xhtml"; ChromeUtils.import("resource://gre/modules/Services.jsm"); -ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://formautofill/FormAutofill.jsm"); ChromeUtils.defineModuleGetter(this, "CreditCard", diff --git a/browser/extensions/formautofill/test/unit/head.js b/browser/extensions/formautofill/test/unit/head.js index a7be03d980f1..28ccf14c410f 100644 --- a/browser/extensions/formautofill/test/unit/head.js +++ b/browser/extensions/formautofill/test/unit/head.js @@ -2,25 +2,18 @@ * Provides infrastructure for automated formautofill components tests. */ -/* exported getTempFile, loadFormAutofillContent, runHeuristicsTest, sinon, - * initProfileStorage, getSyncChangeCounter, objectMatches, bootstrapURI - */ - "use strict"; ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm"); -ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); ChromeUtils.import("resource://gre/modules/ObjectUtils.jsm"); ChromeUtils.import("resource://gre/modules/FormLikeFactory.jsm"); ChromeUtils.import("resource://testing-common/FileTestUtils.jsm"); ChromeUtils.import("resource://testing-common/MockDocument.jsm"); ChromeUtils.import("resource://testing-common/TestUtils.jsm"); -// eslint-disable-next-line no-unused-vars ChromeUtils.defineModuleGetter(this, "DownloadPaths", "resource://gre/modules/DownloadPaths.jsm"); -// eslint-disable-next-line no-unused-vars ChromeUtils.defineModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm"); diff --git a/browser/extensions/formautofill/test/unit/test_profileAutocompleteResult.js b/browser/extensions/formautofill/test/unit/test_profileAutocompleteResult.js index 2643fe49b365..85b614d234a8 100644 --- a/browser/extensions/formautofill/test/unit/test_profileAutocompleteResult.js +++ b/browser/extensions/formautofill/test/unit/test_profileAutocompleteResult.js @@ -1,6 +1,7 @@ "use strict"; /* global AddressResult, CreditCardResult */ +// eslint-disable-next-line no-unused-vars ChromeUtils.import("resource://formautofill/ProfileAutoCompleteResult.jsm"); let matchingProfiles = [{ diff --git a/browser/extensions/pdfjs/content/PdfJsRegistration.jsm b/browser/extensions/pdfjs/content/PdfJsRegistration.jsm index e5a86fc6d755..cb173aab5c0f 100644 --- a/browser/extensions/pdfjs/content/PdfJsRegistration.jsm +++ b/browser/extensions/pdfjs/content/PdfJsRegistration.jsm @@ -19,8 +19,6 @@ var EXPORTED_SYMBOLS = ["PdfJsRegistration"]; const Cm = Components.manager; -ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); - ChromeUtils.defineModuleGetter(this, "PdfStreamConverter", "resource://pdf.js/PdfStreamConverter.jsm");