Bug 1513449 - Port bug 1415483: changes to reject-importGlobalProperties rule. r=jorgk DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 12 Dec 2018 19:58:45 +1300
changeset 33130 999ba6d634bb
parent 33129 0c6641ab10fa
child 33131 9113e787783c
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1513449, 1415483
Bug 1513449 - Port bug 1415483: changes to reject-importGlobalProperties rule. r=jorgk DONTBUILD
calendar/base/modules/utils/calXMLUtils.jsm
calendar/providers/wcap/calWcapUtils.js
common/src/Overlays.jsm
common/test/xpcshell/head_addons.js
mail/base/modules/MailInstrumentation.jsm
mail/components/cloudfile/nsBox.js
mail/components/cloudfile/nsHightail.js
mail/components/extensions/parent/ext-cloudFile.js
mail/components/im/modules/chatNotifications.jsm
mailnews/extensions/newsblog/content/FeedUtils.jsm
mailnews/extensions/newsblog/content/feed-parser.js
--- a/calendar/base/modules/utils/calXMLUtils.jsm
+++ b/calendar/base/modules/utils/calXMLUtils.jsm
@@ -1,14 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-Cu.importGlobalProperties(["XMLSerializer", "XMLHttpRequest", "DOMParser"]);
-
 /*
  * Helper functions for parsing and serializing XML
  */
 
 // NOTE: This module should not be loaded directly, it is available when
 // including calUtils.jsm under the cal.xml namespace.
 
 this.EXPORTED_SYMBOLS = ["calxml"]; /* exported calxml */
--- a/calendar/providers/wcap/calWcapUtils.js
+++ b/calendar/providers/wcap/calWcapUtils.js
@@ -6,18 +6,16 @@
  *          getIcalUTC, getDatetimeFromIcalProp, getWcapString
  */
 
 ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm", null);
 
-Cu.importGlobalProperties(["DOMParser"]);
-
 var g_bShutdown = false;
 
 function initLogging() {
     initLogging.mLogTimezone = cal.dtz.defaultTimezone;
     if (initLogging.mLogFilestream) {
         try {
             initLogging.mLogFilestream.close();
         } catch (exc) {
--- a/common/src/Overlays.jsm
+++ b/common/src/Overlays.jsm
@@ -9,18 +9,16 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Overlays"];
 
 const { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm", null);
 ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
 ChromeUtils.defineModuleGetter(this, "setTimeout", "resource://gre/modules/Timer.jsm");
 
-Cu.importGlobalProperties(["XMLHttpRequest"]);
-
 let oconsole = new ConsoleAPI({
   prefix: "Overlays.jsm",
   consoleID: "overlays-jsm",
   maxLogLevelPref: "extensions.overlayloader.loglevel",
 });
 
 /**
  * The overlays class, providing support for loading overlays like they used to work. This class
--- a/common/test/xpcshell/head_addons.js
+++ b/common/test/xpcshell/head_addons.js
@@ -1,16 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-/* eslint no-unused-vars: ["error", {vars: "local", args: "none"}] */
-
-Cu.importGlobalProperties(["TextEncoder"]);
-
 const PREF_EM_CHECK_UPDATE_SECURITY   = "extensions.checkUpdateSecurity";
 const PREF_EM_STRICT_COMPATIBILITY    = "extensions.strictCompatibility";
 const PREF_GETADDONS_BYIDS               = "extensions.getAddons.get.url";
 const PREF_COMPAT_OVERRIDES              = "extensions.getAddons.compatOverides.url";
 const PREF_XPI_SIGNATURES_REQUIRED    = "xpinstall.signatures.required";
 
 const PREF_DISABLE_SECURITY = ("security.turn_off_all_security_so_that_" +
                                "viruses_can_take_over_this_computer");
--- a/mail/base/modules/MailInstrumentation.jsm
+++ b/mail/base/modules/MailInstrumentation.jsm
@@ -11,18 +11,16 @@
 this.EXPORTED_SYMBOLS = ["MailInstrumentation"];
 
 var nsIMFNService = Ci.nsIMsgFolderNotificationService;
 
 const { logException } = ChromeUtils.import("resource:///modules/errUtils.js", null);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
-Cu.importGlobalProperties(["XMLHttpRequest"]);
-
 /* :::::::: The Module ::::::::::::::: */
 
 var MailInstrumentation = {
   // JS object containing the current state object
   _currentState: null,
 
   /**
    * The string containing the JSON stringified representation of the last
--- a/mail/components/cloudfile/nsBox.js
+++ b/mail/components/cloudfile/nsBox.js
@@ -12,18 +12,16 @@
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
 ChromeUtils.import("resource:///modules/cloudFileAccounts.js");
 ChromeUtils.import("resource:///modules/OAuth2.jsm");
 ChromeUtils.import("resource://gre/modules/Http.jsm");
 
-Cu.importGlobalProperties(["File", "FormData", "XMLHttpRequest"]);
-
 var gServerUrl = "https://api.box.com/2.0/";
 var gUploadUrl = "https://upload.box.com/api/2.0/";
 
 var kAuthBaseUrl = "https://www.box.com/api/";
 var kAuthUrl = "oauth2/authorize";
 
 XPCOMUtils.defineLazyServiceGetter(this, "gProtocolService",
                                    "@mozilla.org/uriloader/external-protocol-service;1",
--- a/mail/components/cloudfile/nsHightail.js
+++ b/mail/components/cloudfile/nsHightail.js
@@ -8,18 +8,16 @@
  * nsIMsgCloudFileProvider interface.
  */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js", null);
 ChromeUtils.import("resource:///modules/cloudFileAccounts.js");
 
-Cu.importGlobalProperties(["XMLHttpRequest"]);
-
 var gServerUrl = "https://dpi.yousendit.com"; // Production url
 // test url var gServerUrl = "https://test2-api.yousendit.com";
 
 var kApiKey = "7spvjdt7m4kycr7jyhywrdn2";
 var kAuthPath = "/dpi/v1/auth";
 var kUserInfoPath = "/dpi/v2/user";
 var kFolderPath = "/dpi/v1/folder/";
 var kFolderFilePath = "/dpi/v1/folder/file/";
--- a/mail/components/extensions/parent/ext-cloudFile.js
+++ b/mail/components/extensions/parent/ext-cloudFile.js
@@ -2,18 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/ExtensionParent.jsm");
 ChromeUtils.import("resource:///modules/cloudFileAccounts.js");
 
-Cu.importGlobalProperties(["File", "FileReader"]);
-
 async function promiseFileRead(nsifile) {
   let blob = await File.createFromNsIFile(nsifile);
 
   return new Promise((resolve, reject) => {
     let reader = new FileReader();
     reader.addEventListener("loadend", () => {
       resolve(reader.result);
     });
--- a/mail/components/im/modules/chatNotifications.jsm
+++ b/mail/components/im/modules/chatNotifications.jsm
@@ -4,17 +4,16 @@
 
 this.EXPORTED_SYMBOLS = ["Notifications"];
 
 const { Services } = ChromeUtils.import("resource:///modules/imServices.jsm", null);
 ChromeUtils.import("resource:///modules/StringBundle.js");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 ChromeUtils.import("resource://gre/modules/Timer.jsm");
-Cu.importGlobalProperties(["DOMParser"]);
 
 // Time in seconds: it is the minimum time of inactivity
 // needed to show the bundled notification.
 var kTimeToWaitForMoreMsgs = 3;
 
 var Notifications = {
   get ellipsis() {
     let ellipsis = "[\u2026]";
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -9,18 +9,16 @@ this.EXPORTED_SYMBOLS = ["Feed", "FeedIt
 ChromeUtils.import("resource:///modules/gloda/log4moz.js");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 ChromeUtils.import("resource:///modules/jsmime.jsm");
 ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-Cu.importGlobalProperties(["XMLHttpRequest"]);
-
 Services.scriptloader.loadSubScript("chrome://messenger-newsblog/content/Feed.js");
 Services.scriptloader.loadSubScript("chrome://messenger-newsblog/content/FeedItem.js");
 Services.scriptloader.loadSubScript("chrome://messenger-newsblog/content/feed-parser.js");
 
 var FeedUtils = {
   MOZ_PARSERERROR_NS: "http://www.mozilla.org/newlayout/xml/parsererror.xml",
 
   /* eslint-disable no-multi-spaces */
--- a/mailnews/extensions/newsblog/content/feed-parser.js
+++ b/mailnews/extensions/newsblog/content/feed-parser.js
@@ -1,15 +1,13 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-Cu.importGlobalProperties(["XMLSerializer"]);
-
 /**
  * The feed parser. Depends on FeedItem.js, Feed.js.
  *
  * @constructor
  */
 function FeedParser() {
   this.parsedItems = [];
   this.mSerializer = new XMLSerializer();