Bug 1439315 - 9 - Remove no more necessary placesOverlayModules. r=standard8 draft
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 01 Mar 2018 14:36:30 +0100
changeset 761877 d6b8ca13e7e9487ea7d8b47b00ab0b00aad69e7a
parent 761876 a4acea017a24de112b1c3bef6ba16d3e0a837a6e
push id101023
push usermak77@bonardo.net
push dateThu, 01 Mar 2018 15:34:13 +0000
reviewersstandard8
bugs1439315
milestone60.0a1
Bug 1439315 - 9 - Remove no more necessary placesOverlayModules. r=standard8 MozReview-Commit-ID: Fa7b0qf4mix
tools/lint/eslint/eslint-plugin-mozilla/lib/environments/places-overlay.js
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/places-overlay.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/places-overlay.js
@@ -11,61 +11,49 @@
 "use strict";
 
 // -----------------------------------------------------------------------------
 // Rule Definition
 // -----------------------------------------------------------------------------
 var path = require("path");
 var helpers = require("../helpers");
 var globals = require("../globals");
-var modules = helpers.modulesGlobalData;
 
 const placesOverlayFiles = [
   "toolkit/content/globalOverlay.js",
   "browser/base/content/utilityOverlay.js"
 ];
 
 const extraPlacesDefinitions = [
   // Via Components.utils, defineModuleGetter, defineLazyModuleGetters or
   // defineLazyScriptGetter (and map to
   // single) variable.
   {name: "XPCOMUtils", writable: false},
   {name: "Task", writable: false},
+  {name: "PlacesUtils", writable: false},
   {name: "PlacesUIUtils", writable: false},
   {name: "PlacesTransactions", writable: false},
   {name: "ForgetAboutSite", writable: false},
   {name: "PlacesTreeView", writable: false},
   {name: "PlacesInsertionPoint", writable: false},
   {name: "PlacesController", writable: false},
   {name: "PlacesControllerDragHelper", writable: false}
 ];
 
-const placesOverlayModules = [
-  "PlacesUtils.jsm"
-];
-
 function getScriptGlobals() {
   let fileGlobals = [];
   for (let file of placesOverlayFiles) {
     let fileName = path.join(helpers.rootDir, file);
     try {
       fileGlobals = fileGlobals.concat(globals.getGlobalsForFile(fileName));
     } catch (e) {
       // The file isn't present, this is probably not an m-c repo.
     }
   }
 
-  for (let file of placesOverlayModules) {
-    if (file in modules) {
-      for (let globalVar of modules[file]) {
-        fileGlobals.push({name: globalVar, writable: false});
-      }
-    }
-  }
-
   return fileGlobals.concat(extraPlacesDefinitions);
 }
 
 function mapGlobals(fileGlobals) {
   var globalObjects = {};
   for (let global of fileGlobals) {
     globalObjects[global.name] = global.writable;
   }