chore(mc): Port Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. (#4002)

This commit is contained in:
Ed Lee 2018-03-01 11:08:44 -08:00 коммит произвёл GitHub
Родитель 9df2a5ee0d
Коммит defc6cfecb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
32 изменённых файлов: 50 добавлений и 41 удалений

Просмотреть файл

@ -19,6 +19,19 @@ module.exports = {
"eslint:recommended",
"plugin:mozilla/recommended" // require("eslint-plugin-mozilla")
],
"overrides": [{
// Use a configuration that's more appropriate for JSMs
"files": "**/*.jsm",
"parserOptions": {
"sourceType": "script"
},
"env": {
"node": false
},
"rules": {
"no-implicit-globals": 0
}
}],
"rules": {
"promise/catch-or-return": 2,
"promise/param-names": 2,

Просмотреть файл

@ -340,7 +340,7 @@ this.actionUtils = {
_RouteMessage
};
this.EXPORTED_SYMBOLS = [
const EXPORTED_SYMBOLS = [
"actionTypes",
"actionCreators",
"actionUtils",

Просмотреть файл

@ -31,4 +31,4 @@ this.Dedupe = class Dedupe {
}
};
this.EXPORTED_SYMBOLS = ["Dedupe"];
const EXPORTED_SYMBOLS = ["Dedupe"];

Просмотреть файл

@ -26,7 +26,7 @@ if (typeof Services !== "undefined") {
};
}
this._PerfService = function _PerfService(options) {
function _PerfService(options) {
// For testing, so that we can use a fake Window.performance object with
// known state.
if (options && options.performanceObj) {
@ -34,7 +34,7 @@ this._PerfService = function _PerfService(options) {
} else {
this._perf = usablePerfObj;
}
};
}
_PerfService.prototype = {
/**
@ -122,4 +122,4 @@ _PerfService.prototype = {
};
this.perfService = new _PerfService();
this.EXPORTED_SYMBOLS = ["_PerfService", "perfService"];
const EXPORTED_SYMBOLS = ["_PerfService", "perfService"];

Просмотреть файл

@ -96,4 +96,4 @@ this.PrerenderData = new _PrerenderData({
});
this._PrerenderData = _PrerenderData;
this.EXPORTED_SYMBOLS = ["PrerenderData", "_PrerenderData"];
const EXPORTED_SYMBOLS = ["PrerenderData", "_PrerenderData"];

Просмотреть файл

@ -356,6 +356,5 @@ this.TOP_SITES_DEFAULT_ROWS = TOP_SITES_DEFAULT_ROWS;
this.TOP_SITES_MAX_SITES_PER_ROW = TOP_SITES_MAX_SITES_PER_ROW;
this.reducers = {TopSites, App, Snippets, Prefs, Dialog, Sections, PreferencesPane};
this.insertPinned = insertPinned;
this.EXPORTED_SYMBOLS = ["reducers", "INITIAL_STATE", "insertPinned", "TOP_SITES_DEFAULT_ROWS", "TOP_SITES_MAX_SITES_PER_ROW"];
const EXPORTED_SYMBOLS = ["reducers", "INITIAL_STATE", "insertPinned", "TOP_SITES_DEFAULT_ROWS", "TOP_SITES_MAX_SITES_PER_ROW"];

Просмотреть файл

@ -347,4 +347,4 @@ this.ActivityStream = class ActivityStream {
}
};
this.EXPORTED_SYMBOLS = ["ActivityStream", "PREFS_CONFIG"];
const EXPORTED_SYMBOLS = ["ActivityStream", "PREFS_CONFIG"];

Просмотреть файл

@ -256,4 +256,4 @@ this.ActivityStreamMessageChannel = class ActivityStreamMessageChannel {
};
this.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
this.EXPORTED_SYMBOLS = ["ActivityStreamMessageChannel", "DEFAULT_OPTIONS"];
const EXPORTED_SYMBOLS = ["ActivityStreamMessageChannel", "DEFAULT_OPTIONS"];

Просмотреть файл

@ -103,4 +103,4 @@ this.DefaultPrefs = class DefaultPrefs {
}
};
this.EXPORTED_SYMBOLS = ["DefaultPrefs", "Prefs"];
const EXPORTED_SYMBOLS = ["DefaultPrefs", "Prefs"];

Просмотреть файл

@ -158,4 +158,4 @@ this.FaviconFeed = class FaviconFeed {
}
};
this.EXPORTED_SYMBOLS = ["FaviconFeed"];
const EXPORTED_SYMBOLS = ["FaviconFeed"];

Просмотреть файл

@ -35,7 +35,7 @@ function md5Hash(text) {
/**
* Filter out any link objects that have a url with an adult base domain.
*/
this.filterAdult = function filterAdult(links) {
function filterAdult(links) {
return links.filter(({url}) => {
try {
const uri = Services.io.newURI(url);
@ -44,9 +44,9 @@ this.filterAdult = function filterAdult(links) {
return true;
}
});
};
}
this.EXPORTED_SYMBOLS = ["filterAdult"];
const EXPORTED_SYMBOLS = ["filterAdult"];
// These are md5 hashes of base domains to be filtered out. Originally from:
// https://hg.mozilla.org/mozilla-central/log/default/browser/base/content/newtab/newTab.inadjacent.json

Просмотреть файл

@ -224,4 +224,4 @@ this.HighlightsFeed = class HighlightsFeed {
}
};
this.EXPORTED_SYMBOLS = ["HighlightsFeed", "SECTION_ID", "MANY_EXTRA_LENGTH"];
const EXPORTED_SYMBOLS = ["HighlightsFeed", "SECTION_ID", "MANY_EXTRA_LENGTH"];

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
this.EXPORTED_SYMBOLS = ["LinksCache"];
const EXPORTED_SYMBOLS = ["LinksCache"];
// This should be slightly less than SYSTEM_TICK_INTERVAL as timer
// comparisons are too exact while the async/await functionality will make the

Просмотреть файл

@ -96,4 +96,4 @@ this.ManualMigration = class ManualMigration {
}
};
this.EXPORTED_SYMBOLS = ["ManualMigration"];
const EXPORTED_SYMBOLS = ["ManualMigration"];

Просмотреть файл

@ -49,4 +49,4 @@ this.NewTabInit = class NewTabInit {
}
};
this.EXPORTED_SYMBOLS = ["NewTabInit"];
const EXPORTED_SYMBOLS = ["NewTabInit"];

Просмотреть файл

@ -79,4 +79,4 @@ this.PersistentCache = class PersistentCache {
}
};
this.EXPORTED_SYMBOLS = ["PersistentCache"];
const EXPORTED_SYMBOLS = ["PersistentCache"];

Просмотреть файл

@ -326,4 +326,4 @@ this.PlacesFeed = PlacesFeed;
PlacesFeed.HistoryObserver = HistoryObserver;
PlacesFeed.BookmarksObserver = BookmarksObserver;
this.EXPORTED_SYMBOLS = ["PlacesFeed"];
const EXPORTED_SYMBOLS = ["PlacesFeed"];

Просмотреть файл

@ -93,4 +93,4 @@ this.PrefsFeed = class PrefsFeed {
}
};
this.EXPORTED_SYMBOLS = ["PrefsFeed"];
const EXPORTED_SYMBOLS = ["PrefsFeed"];

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
this.EXPORTED_SYMBOLS = ["Screenshots"];
const EXPORTED_SYMBOLS = ["Screenshots"];
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");

Просмотреть файл

@ -348,4 +348,4 @@ class SectionsFeed {
this.SectionsFeed = SectionsFeed;
this.SectionsManager = SectionsManager;
this.EXPORTED_SYMBOLS = ["SectionsFeed", "SectionsManager"];
const EXPORTED_SYMBOLS = ["SectionsFeed", "SectionsManager"];

Просмотреть файл

@ -33,8 +33,6 @@ function getETLD(host) {
}
}
this.getETLD = getETLD;
/**
* shortURL - Creates a short version of a link's url, used for display purposes
* e.g. {url: http://www.foosite.com} => "foosite"
@ -43,7 +41,7 @@ this.getETLD = getETLD;
* {str} link.url (required)- The url of the link
* @return {str} A short url
*/
this.shortURL = function shortURL({url}) {
function shortURL({url}) {
if (!url) {
return "";
}
@ -67,6 +65,6 @@ this.shortURL = function shortURL({url}) {
// Ideally get the short eTLD-less host but fall back to longer url parts
return handleIDNHost(hostname.slice(0, eTLDExtra) || hostname) ||
parsed.pathname || parsed.href;
};
}
this.EXPORTED_SYMBOLS = ["shortURL", "getETLD"];
const EXPORTED_SYMBOLS = ["shortURL", "getETLD"];

Просмотреть файл

@ -196,4 +196,4 @@ this.SnippetsFeed = class SnippetsFeed {
}
};
this.EXPORTED_SYMBOLS = ["SnippetsFeed"];
const EXPORTED_SYMBOLS = ["SnippetsFeed"];

Просмотреть файл

@ -157,4 +157,4 @@ this.Store = class Store {
}
};
this.EXPORTED_SYMBOLS = ["Store"];
const EXPORTED_SYMBOLS = ["Store"];

Просмотреть файл

@ -31,4 +31,4 @@ this.SystemTickFeed = class SystemTickFeed {
};
this.SYSTEM_TICK_INTERVAL = SYSTEM_TICK_INTERVAL;
this.EXPORTED_SYMBOLS = ["SystemTickFeed", "SYSTEM_TICK_INTERVAL"];
const EXPORTED_SYMBOLS = ["SystemTickFeed", "SYSTEM_TICK_INTERVAL"];

Просмотреть файл

@ -472,7 +472,7 @@ this.TelemetryFeed = class TelemetryFeed {
}
};
this.EXPORTED_SYMBOLS = [
const EXPORTED_SYMBOLS = [
"TelemetryFeed",
"USER_PREFS_ENCODING",
"PREF_IMPRESSION_ID",

Просмотреть файл

@ -17,7 +17,6 @@ function getDomain(url) {
}
return domain;
}
this.getDomain = getDomain;
this.TippyTopProvider = class TippyTopProvider {
constructor() {
@ -51,4 +50,4 @@ this.TippyTopProvider = class TippyTopProvider {
}
};
this.EXPORTED_SYMBOLS = ["TippyTopProvider", "getDomain"];
const EXPORTED_SYMBOLS = ["TippyTopProvider", "getDomain"];

Просмотреть файл

@ -347,4 +347,4 @@ this.TopSitesFeed = class TopSitesFeed {
};
this.DEFAULT_TOP_SITES = DEFAULT_TOP_SITES;
this.EXPORTED_SYMBOLS = ["TopSitesFeed", "DEFAULT_TOP_SITES"];
const EXPORTED_SYMBOLS = ["TopSitesFeed", "DEFAULT_TOP_SITES"];

Просмотреть файл

@ -506,4 +506,4 @@ this.SPOC_IMPRESSION_TRACKING_PREF = SPOC_IMPRESSION_TRACKING_PREF;
this.REC_IMPRESSION_TRACKING_PREF = REC_IMPRESSION_TRACKING_PREF;
this.MIN_DOMAIN_AFFINITIES_UPDATE_TIME = MIN_DOMAIN_AFFINITIES_UPDATE_TIME;
this.DEFAULT_RECS_EXPIRE_TIME = DEFAULT_RECS_EXPIRE_TIME;
this.EXPORTED_SYMBOLS = ["TopStoriesFeed", "STORIES_UPDATE_TIME", "TOPICS_UPDATE_TIME", "SECTION_ID", "SPOC_IMPRESSION_TRACKING_PREF", "MIN_DOMAIN_AFFINITIES_UPDATE_TIME", "REC_IMPRESSION_TRACKING_PREF", "DEFAULT_RECS_EXPIRE_TIME"];
const EXPORTED_SYMBOLS = ["TopStoriesFeed", "STORIES_UPDATE_TIME", "TOPICS_UPDATE_TIME", "SECTION_ID", "SPOC_IMPRESSION_TRACKING_PREF", "MIN_DOMAIN_AFFINITIES_UPDATE_TIME", "REC_IMPRESSION_TRACKING_PREF", "DEFAULT_RECS_EXPIRE_TIME"];

Просмотреть файл

@ -56,4 +56,4 @@ this.UTEventReporting = class UTEventReporting {
}
};
this.EXPORTED_SYMBOLS = ["UTEventReporting"];
const EXPORTED_SYMBOLS = ["UTEventReporting"];

Просмотреть файл

@ -326,4 +326,4 @@ this.UserDomainAffinityProvider = class UserDomainAffinityProvider {
}
};
this.EXPORTED_SYMBOLS = ["UserDomainAffinityProvider"];
const EXPORTED_SYMBOLS = ["UserDomainAffinityProvider"];

Просмотреть файл

@ -195,4 +195,4 @@ this.PingCentreConstants = {
TELEMETRY_PREF,
LOGGING_PREF
};
this.EXPORTED_SYMBOLS = ["PingCentre", "PingCentreConstants"];
const EXPORTED_SYMBOLS = ["PingCentre", "PingCentreConstants"];

2
system-addon/vendor/Redux.jsm поставляемый
Просмотреть файл

@ -3,7 +3,7 @@
*
* This file has been reformatted as a Javascript Core Module
*/
this.EXPORTED_SYMBOLS = ["redux"];
const EXPORTED_SYMBOLS = ["redux"];
// Defining these prevents redux from using indirect eval or `new
// Function()` to get its global object.