Bug 1824260 - esmify mailnews/. r=freaktechnik

Differential Revision: https://phabricator.services.mozilla.com/D204279

--HG--
rename : mailnews/addrbook/modules/AddrBookDirectory.jsm => mailnews/addrbook/modules/AddrBookDirectory.sys.mjs
rename : mailnews/addrbook/modules/AddrBookMailingList.jsm => mailnews/addrbook/modules/AddrBookMailingList.sys.mjs
rename : mailnews/addrbook/modules/AddrBookUtils.jsm => mailnews/addrbook/modules/AddrBookUtils.sys.mjs
rename : mailnews/addrbook/modules/CardDAVUtils.jsm => mailnews/addrbook/modules/CardDAVUtils.sys.mjs
rename : mailnews/addrbook/modules/LDAPClient.jsm => mailnews/addrbook/modules/LDAPClient.sys.mjs
rename : mailnews/addrbook/modules/LDAPListenerBase.jsm => mailnews/addrbook/modules/LDAPListenerBase.sys.mjs
rename : mailnews/addrbook/modules/LDAPMessage.jsm => mailnews/addrbook/modules/LDAPMessage.sys.mjs
rename : mailnews/addrbook/modules/QueryStringToExpression.jsm => mailnews/addrbook/modules/QueryStringToExpression.sys.mjs
rename : mailnews/addrbook/test/CardDAVServer.jsm => mailnews/addrbook/test/CardDAVServer.sys.mjs
rename : mailnews/addrbook/test/LDAPServer.jsm => mailnews/addrbook/test/LDAPServer.sys.mjs
rename : mailnews/base/src/ABQueryUtils.jsm => mailnews/base/src/ABQueryUtils.sys.mjs
rename : mailnews/base/src/FolderUtils.jsm => mailnews/base/src/FolderUtils.sys.mjs
rename : mailnews/base/src/JXON.jsm => mailnews/base/src/JXON.sys.mjs
rename : mailnews/base/src/LineReader.jsm => mailnews/base/src/LineReader.sys.mjs
rename : mailnews/base/src/MailAuthenticator.jsm => mailnews/base/src/MailAuthenticator.sys.mjs
rename : mailnews/base/src/MailCryptoUtils.jsm => mailnews/base/src/MailCryptoUtils.sys.mjs
rename : mailnews/base/src/MailServices.jsm => mailnews/base/src/MailServices.sys.mjs
rename : mailnews/base/src/MailStringUtils.jsm => mailnews/base/src/MailStringUtils.sys.mjs
rename : mailnews/base/src/MailnewsMigrator.jsm => mailnews/base/src/MailnewsMigrator.sys.mjs
rename : mailnews/base/src/MsgDBCacheManager.jsm => mailnews/base/src/MsgDBCacheManager.sys.mjs
rename : mailnews/base/src/MsgIncomingServer.jsm => mailnews/base/src/MsgIncomingServer.sys.mjs
rename : mailnews/base/src/MsgKeySet.jsm => mailnews/base/src/MsgKeySet.sys.mjs
rename : mailnews/base/src/OAuth2.jsm => mailnews/base/src/OAuth2.sys.mjs
rename : mailnews/base/src/OAuth2Providers.jsm => mailnews/base/src/OAuth2Providers.sys.mjs
rename : mailnews/base/src/TemplateUtils.jsm => mailnews/base/src/TemplateUtils.sys.mjs
rename : mailnews/base/src/VirtualFolderWrapper.jsm => mailnews/base/src/VirtualFolderWrapper.sys.mjs
rename : mailnews/base/src/WinUnreadBadge.jsm => mailnews/base/src/WinUnreadBadge.sys.mjs
rename : mailnews/base/src/hostnameUtils.jsm => mailnews/base/src/hostnameUtils.sys.mjs
rename : mailnews/base/src/mailstoreConverter.jsm => mailnews/base/src/mailstoreConverter.sys.mjs
rename : mailnews/compose/src/MimeEncoder.jsm => mailnews/compose/src/MimeEncoder.sys.mjs
rename : mailnews/compose/src/MimeMessage.jsm => mailnews/compose/src/MimeMessage.sys.mjs
rename : mailnews/compose/src/MimeMessageUtils.jsm => mailnews/compose/src/MimeMessageUtils.sys.mjs
rename : mailnews/compose/src/MimePart.jsm => mailnews/compose/src/MimePart.sys.mjs
rename : mailnews/compose/src/SmtpClient.jsm => mailnews/compose/src/SmtpClient.sys.mjs
rename : mailnews/db/gloda/modules/Collection.jsm => mailnews/db/gloda/modules/Collection.sys.mjs
rename : mailnews/db/gloda/modules/Everybody.jsm => mailnews/db/gloda/modules/Everybody.sys.mjs
rename : mailnews/db/gloda/modules/Facet.jsm => mailnews/db/gloda/modules/Facet.sys.mjs
rename : mailnews/db/gloda/modules/Gloda.jsm => mailnews/db/gloda/modules/Gloda.sys.mjs
rename : mailnews/db/gloda/modules/GlodaConstants.jsm => mailnews/db/gloda/modules/GlodaConstants.sys.mjs
rename : mailnews/db/gloda/modules/GlodaContent.jsm => mailnews/db/gloda/modules/GlodaContent.sys.mjs
rename : mailnews/db/gloda/modules/GlodaDataModel.jsm => mailnews/db/gloda/modules/GlodaDataModel.sys.mjs
rename : mailnews/db/gloda/modules/GlodaDatabind.jsm => mailnews/db/gloda/modules/GlodaDatabind.sys.mjs
rename : mailnews/db/gloda/modules/GlodaDatastore.jsm => mailnews/db/gloda/modules/GlodaDatastore.sys.mjs
rename : mailnews/db/gloda/modules/GlodaExplicitAttr.jsm => mailnews/db/gloda/modules/GlodaExplicitAttr.sys.mjs
rename : mailnews/db/gloda/modules/GlodaFundAttr.jsm => mailnews/db/gloda/modules/GlodaFundAttr.sys.mjs
rename : mailnews/db/gloda/modules/GlodaIndexer.jsm => mailnews/db/gloda/modules/GlodaIndexer.sys.mjs
rename : mailnews/db/gloda/modules/GlodaMsgIndexer.jsm => mailnews/db/gloda/modules/GlodaMsgIndexer.sys.mjs
rename : mailnews/db/gloda/modules/GlodaMsgSearcher.jsm => mailnews/db/gloda/modules/GlodaMsgSearcher.sys.mjs
rename : mailnews/db/gloda/modules/GlodaPublic.jsm => mailnews/db/gloda/modules/GlodaPublic.sys.mjs
rename : mailnews/db/gloda/modules/GlodaQueryClassFactory.jsm => mailnews/db/gloda/modules/GlodaQueryClassFactory.sys.mjs
rename : mailnews/db/gloda/modules/GlodaSyntheticView.jsm => mailnews/db/gloda/modules/GlodaSyntheticView.sys.mjs
rename : mailnews/db/gloda/modules/GlodaUtils.jsm => mailnews/db/gloda/modules/GlodaUtils.sys.mjs
rename : mailnews/db/gloda/modules/IndexMsg.jsm => mailnews/db/gloda/modules/IndexMsg.sys.mjs
rename : mailnews/db/gloda/modules/MimeMessage.jsm => mailnews/db/gloda/modules/MimeMessage.sys.mjs
rename : mailnews/db/gloda/modules/NounFreetag.jsm => mailnews/db/gloda/modules/NounFreetag.sys.mjs
rename : mailnews/db/gloda/modules/NounMimetype.jsm => mailnews/db/gloda/modules/NounMimetype.sys.mjs
rename : mailnews/db/gloda/modules/NounTag.jsm => mailnews/db/gloda/modules/NounTag.sys.mjs
rename : mailnews/db/gloda/modules/SuffixTree.jsm => mailnews/db/gloda/modules/SuffixTree.sys.mjs
rename : mailnews/db/gloda/test/unit/resources/GlodaQueryHelper.jsm => mailnews/db/gloda/test/unit/resources/GlodaQueryHelper.sys.mjs
rename : mailnews/db/gloda/test/unit/resources/GlodaTestHelper.jsm => mailnews/db/gloda/test/unit/resources/GlodaTestHelper.sys.mjs
rename : mailnews/db/gloda/test/unit/resources/GlodaTestHelperFunctions.jsm => mailnews/db/gloda/test/unit/resources/GlodaTestHelperFunctions.sys.mjs
rename : mailnews/export/modules/ProfileExporter.jsm => mailnews/export/modules/ProfileExporter.sys.mjs
rename : mailnews/extensions/newsblog/Feed.jsm => mailnews/extensions/newsblog/Feed.sys.mjs
rename : mailnews/extensions/newsblog/FeedItem.jsm => mailnews/extensions/newsblog/FeedItem.sys.mjs
rename : mailnews/extensions/newsblog/FeedParser.jsm => mailnews/extensions/newsblog/FeedParser.sys.mjs
rename : mailnews/extensions/newsblog/FeedUtils.jsm => mailnews/extensions/newsblog/FeedUtils.sys.mjs
rename : mailnews/imap/src/ImapChannel.jsm => mailnews/imap/src/ImapChannel.sys.mjs
rename : mailnews/imap/src/ImapClient.jsm => mailnews/imap/src/ImapClient.sys.mjs
rename : mailnews/imap/src/ImapIncomingServer.jsm => mailnews/imap/src/ImapIncomingServer.sys.mjs
rename : mailnews/imap/src/ImapMessageService.jsm => mailnews/imap/src/ImapMessageService.sys.mjs
rename : mailnews/imap/src/ImapProtocolHandler.jsm => mailnews/imap/src/ImapProtocolHandler.sys.mjs
rename : mailnews/imap/src/ImapProtocolInfo.jsm => mailnews/imap/src/ImapProtocolInfo.sys.mjs
rename : mailnews/imap/src/ImapResponse.jsm => mailnews/imap/src/ImapResponse.sys.mjs
rename : mailnews/imap/src/ImapService.jsm => mailnews/imap/src/ImapService.sys.mjs
rename : mailnews/imap/src/ImapUtils.jsm => mailnews/imap/src/ImapUtils.sys.mjs
rename : mailnews/import/modules/AddrBookFileImporter.jsm => mailnews/import/modules/AddrBookFileImporter.sys.mjs
rename : mailnews/import/modules/AppleMailProfileImporter.jsm => mailnews/import/modules/AppleMailProfileImporter.sys.mjs
rename : mailnews/import/modules/BaseProfileImporter.jsm => mailnews/import/modules/BaseProfileImporter.sys.mjs
rename : mailnews/import/modules/BeckyProfileImporter.jsm => mailnews/import/modules/BeckyProfileImporter.sys.mjs
rename : mailnews/import/modules/CalendarFileImporter.jsm => mailnews/import/modules/CalendarFileImporter.sys.mjs
rename : mailnews/import/modules/OutlookProfileImporter.jsm => mailnews/import/modules/OutlookProfileImporter.sys.mjs
rename : mailnews/import/modules/SeamonkeyProfileImporter.jsm => mailnews/import/modules/SeamonkeyProfileImporter.sys.mjs
rename : mailnews/import/modules/ThunderbirdProfileImporter.jsm => mailnews/import/modules/ThunderbirdProfileImporter.sys.mjs
rename : mailnews/jsaccount/modules/JSAccountUtils.jsm => mailnews/jsaccount/modules/JSAccountUtils.sys.mjs
rename : mailnews/jsaccount/modules/JaBaseUrl.jsm => mailnews/jsaccount/modules/JaBaseUrl.sys.mjs
rename : mailnews/jsaccount/test/unit/resources/testJaBaseIncomingServer.jsm => mailnews/jsaccount/test/unit/resources/testJaBaseIncomingServer.sys.mjs
rename : mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.jsm => mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.sys.mjs
rename : mailnews/local/src/Pop3Channel.jsm => mailnews/local/src/Pop3Channel.sys.mjs
rename : mailnews/local/src/Pop3Client.jsm => mailnews/local/src/Pop3Client.sys.mjs
rename : mailnews/mime/src/jsmime.jsm => mailnews/mime/src/jsmime.sys.mjs
rename : mailnews/mime/src/mimeParser.jsm => mailnews/mime/src/mimeParser.sys.mjs
rename : mailnews/news/src/NntpChannel.jsm => mailnews/news/src/NntpChannel.sys.mjs
rename : mailnews/news/src/NntpClient.jsm => mailnews/news/src/NntpClient.sys.mjs
rename : mailnews/news/src/NntpNewsGroup.jsm => mailnews/news/src/NntpNewsGroup.sys.mjs
rename : mailnews/news/src/NntpUtils.jsm => mailnews/news/src/NntpUtils.sys.mjs
rename : mailnews/search/src/PeriodicFilterManager.jsm => mailnews/search/src/PeriodicFilterManager.sys.mjs
extra : rebase_source : 0d95b8d8e0eb6134fe513fab1793e34bab974206
This commit is contained in:
Magnus Melin 2024-03-12 17:01:01 +02:00
Родитель 2b23e8d718
Коммит 1ae693417e
414 изменённых файлов: 1511 добавлений и 2078 удалений

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

@ -17,8 +17,8 @@ var { MessageGenerator, MessageScenarioFactory } = ChromeUtils.importESModule(
var { MessageInjection } = ChromeUtils.importESModule(
"resource://testing-common/mailnews/MessageInjection.sys.mjs"
);
var { dump_view_state } = ChromeUtils.import(
"resource://testing-common/mozmill/ViewHelpers.jsm"
var { dump_view_state } = ChromeUtils.importESModule(
"resource://testing-common/mozmill/ViewHelpers.sys.mjs"
);
var gMessageGenerator;

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

@ -2,9 +2,12 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import * as EventUtils from "resource://testing-common/mozmill/EventUtils.sys.mjs";
import {
promise_new_window,
wait_for_existing_window,
@ -16,12 +19,7 @@ import { BrowserTestUtils } from "resource://testing-common/BrowserTestUtils.sys
import { SmartServerUtils } from "resource:///modules/SmartServerUtils.sys.mjs";
import { TestUtils } from "resource://testing-common/TestUtils.sys.mjs";
var nsMsgViewIndex_None = 0xffffffff;
import { MailConsts } from "resource:///modules/MailConsts.sys.mjs";
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailUtils } from "resource:///modules/MailUtils.sys.mjs";
import {
MessageGenerator,
@ -30,10 +28,9 @@ import {
} from "resource://testing-common/mailnews/MessageGenerator.sys.mjs";
import { MessageInjection } from "resource://testing-common/mailnews/MessageInjection.sys.mjs";
import { SmimeUtils } from "resource://testing-common/mailnews/SmimeUtils.sys.mjs";
import { dump_view_state } from "resource://testing-common/mozmill/ViewHelpers.sys.mjs";
var { dump_view_state } = ChromeUtils.import(
"resource://testing-common/mozmill/ViewHelpers.jsm"
);
var nsMsgViewIndex_None = 0xffffffff;
/**
* Server hostname as set in runtest.py

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var gOkButton;

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

@ -2,13 +2,9 @@
* 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/. */
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
XPCOMUtils.defineLazyModuleGetters(this, {
CardDAVUtils: "resource:///modules/CardDAVUtils.jsm",
MailServices: "resource:///modules/MailServices.jsm",
ChromeUtils.defineESModuleGetters(this, {
CardDAVUtils: "resource:///modules/CardDAVUtils.sys.mjs",
MailServices: "resource:///modules/MailServices.sys.mjs",
});
var log = console.createInstance({

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var gDirectory = window.arguments[0].selectedDirectory;

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

@ -5,8 +5,8 @@
/* import-globals-from ../../../mail/components/addrbook/content/abCommon.js */
/* import-globals-from ../../../mail/components/compose/content/addressingWidgetOverlay.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"

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

@ -2,18 +2,12 @@
* 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/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BANISHED_PROPERTIES: "resource:///modules/VCardUtils.sys.mjs",
VCardProperties: "resource:///modules/VCardUtils.sys.mjs",
VCardPropertyEntry: "resource:///modules/VCardUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
newUID: "resource:///modules/AddrBookUtils.jsm",
newUID: "resource:///modules/AddrBookUtils.sys.mjs",
});
/**

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

@ -2,23 +2,17 @@
* 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/. */
const EXPORTED_SYMBOLS = ["AddrBookDirectory"];
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
AddrBookCard: "resource:///modules/AddrBookCard.sys.mjs",
AddrBookMailingList: "resource:///modules/AddrBookMailingList.sys.mjs",
BANISHED_PROPERTIES: "resource:///modules/VCardUtils.sys.mjs",
VCardProperties: "resource:///modules/VCardUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
AddrBookMailingList: "resource:///modules/AddrBookMailingList.jsm",
compareAddressBooks: "resource:///modules/AddrBookUtils.jsm",
newUID: "resource:///modules/AddrBookUtils.jsm",
compareAddressBooks: "resource:///modules/AddrBookUtils.sys.mjs",
newUID: "resource:///modules/AddrBookUtils.sys.mjs",
});
/**
@ -27,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* @abstract
* @implements {nsIAbDirectory}
*/
class AddrBookDirectory {
export class AddrBookDirectory {
QueryInterface = ChromeUtils.generateQI(["nsIAbDirectory"]);
constructor() {

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

@ -2,20 +2,19 @@
* 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/. */
const EXPORTED_SYMBOLS = ["AddrBookMailingList"];
/* Prototype for mailing lists. A mailing list can appear as nsIAbDirectory
* or as nsIAbCard. Here we keep all relevant information in the class itself
* and fulfill each interface on demand. This will make more sense and be
* a lot neater once we stop using two XPCOM interfaces for one job. */
function AddrBookMailingList(uid, parent, name, nickName, description) {
export function AddrBookMailingList(uid, parent, name, nickName, description) {
this._uid = uid;
this._parent = parent;
this._name = name;
this._nickName = nickName;
this._description = description;
}
AddrBookMailingList.prototype = {
get asDirectory() {
const self = this;

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

@ -4,20 +4,14 @@
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
MailGlue: "resource:///modules/MailGlue.sys.mjs",
clearTimeout: "resource://gre/modules/Timer.sys.mjs",
compareAddressBooks: "resource:///modules/AddrBookUtils.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
compareAddressBooks: "resource:///modules/AddrBookUtils.jsm",
});
/** Test for valid directory URIs. */
const URI_REGEXP = /^([\w-]+):\/\/([\w\.-]*)([/:].*|$)/;

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

@ -2,25 +2,11 @@
* 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/. */
const EXPORTED_SYMBOLS = [
"exportAttributes",
"AddrBookUtils",
"compareAddressBooks",
"newUID",
];
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { MailStringUtils } = ChromeUtils.import(
"resource:///modules/MailStringUtils.jsm"
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
import { MailStringUtils } from "resource:///modules/MailStringUtils.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
@ -31,7 +17,7 @@ XPCOMUtils.defineLazyServiceGetters(lazy, {
],
});
function newUID() {
export function newUID() {
return Services.uuid.generateUUID().toString().substring(1, 37);
}
@ -56,7 +42,7 @@ const abNameComparer = new Intl.Collator(undefined, { numeric: true });
* @param {nsIAbDirectory} b
* @returns {integer}
*/
function compareAddressBooks(a, b) {
export function compareAddressBooks(a, b) {
if (a.isMailList != b.isMailList) {
throw Components.Exception(
"Tried to compare a mailing list with a directory",
@ -92,7 +78,7 @@ function compareAddressBooks(a, b) {
return abNameComparer.compare(a.dirName, b.dirName);
}
const exportAttributes = [
export const exportAttributes = [
["FirstName", 2100],
["LastName", 2101],
["DisplayName", 2102],
@ -142,9 +128,10 @@ const exportAttributes = [
["SpouseName", 0],
["FamilyName", 0],
];
const LINEBREAK = AppConstants.platform == "win" ? "\r\n" : "\n";
var AddrBookUtils = {
export var AddrBookUtils = {
compareAddressBooks,
async exportDirectory(directory) {
let systemCharset = "utf-8";

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

@ -2,14 +2,14 @@
* 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/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
import { SQLiteDirectory } from "resource:///modules/SQLiteDirectory.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
CardDAVUtils: "resource:///modules/CardDAVUtils.sys.mjs",
NotificationCallbacks: "resource:///modules/CardDAVUtils.sys.mjs",
OAuth2Module: "resource:///modules/OAuth2Module.sys.mjs",
OAuth2Providers: "resource:///modules/OAuth2Providers.sys.mjs",
VCardProperties: "resource:///modules/VCardUtils.sys.mjs",
VCardUtils: "resource:///modules/VCardUtils.sys.mjs",
clearInterval: "resource://gre/modules/Timer.sys.mjs",
@ -17,12 +17,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
setTimeout: "resource://gre/modules/Timer.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
CardDAVUtils: "resource:///modules/CardDAVUtils.jsm",
NotificationCallbacks: "resource:///modules/CardDAVUtils.jsm",
OAuth2Providers: "resource:///modules/OAuth2Providers.jsm",
});
const PREFIX_BINDINGS = {
card: "urn:ietf:params:xml:ns:carddav",
cs: "http://calendarserver.org/ns/",

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

@ -2,15 +2,10 @@
* 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/. */
const EXPORTED_SYMBOLS = ["CardDAVUtils", "NotificationCallbacks"];
import { DNS } from "resource:///modules/DNS.sys.mjs";
const { DNS } = ChromeUtils.importESModule("resource:///modules/DNS.sys.mjs");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
@ -21,12 +16,10 @@ ChromeUtils.defineESModuleGetters(lazy, {
"resource://gre/modules/ContextualIdentityService.sys.mjs",
MsgAuthPrompt: "resource:///modules/MsgAsyncPrompter.sys.mjs",
OAuth2: "resource:///modules/OAuth2.sys.mjs",
OAuth2Providers: "resource:///modules/OAuth2Providers.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
OAuth2: "resource:///modules/OAuth2.jsm",
OAuth2Providers: "resource:///modules/OAuth2Providers.jsm",
});
XPCOMUtils.defineLazyServiceGetter(
lazy,
"nssErrorsService",
@ -56,7 +49,7 @@ const writePrivs = ["write", "write-properties", "write-content", "all"];
// book readable.
const readPrivs = ["read", "all"];
var CardDAVUtils = {
export var CardDAVUtils = {
_contextMap: new Map(),
/**
@ -590,7 +583,7 @@ var CardDAVUtils = {
* @implements {nsIAuthPrompt2}
* @implements {nsIChannelEventSink}
*/
class NotificationCallbacks {
export class NotificationCallbacks {
/**
* @param {string} [username] - Used to pre-fill any auth dialogs.
* @param {string} [password] - Used to pre-fill any auth dialogs.

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

@ -2,23 +2,18 @@
* 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/. */
const EXPORTED_SYMBOLS = ["LDAPClient"];
import { CommonUtils } from "resource://services-common/utils.sys.mjs";
var { CommonUtils } = ChromeUtils.importESModule(
"resource://services-common/utils.sys.mjs"
);
var { setTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
var {
import { setTimeout } from "resource://gre/modules/Timer.sys.mjs";
import {
AbandonRequest,
BindRequest,
UnbindRequest,
SearchRequest,
LDAPResponse,
} = ChromeUtils.import("resource:///modules/LDAPMessage.jsm");
} from "resource:///modules/LDAPMessage.sys.mjs";
class LDAPClient {
export class LDAPClient {
/**
* @param {string} host - The LDAP server host.
* @param {number} port - The LDAP server port.

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

@ -4,11 +4,9 @@
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"LDAPClient",
"resource:///modules/LDAPClient.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
LDAPClient: "resource:///modules/LDAPClient.sys.mjs",
});
/**
* A module to manage LDAP connection.

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

@ -2,30 +2,21 @@
* 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/. */
const { AddrBookDirectory } = ChromeUtils.import(
"resource:///modules/AddrBookDirectory.jsm"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { AddrBookDirectory } from "resource:///modules/AddrBookDirectory.sys.mjs";
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
QueryStringToExpression: "resource:///modules/QueryStringToExpression.jsm",
QueryStringToExpression:
"resource:///modules/QueryStringToExpression.sys.mjs",
});
/**
* @augments {AddrBookDirectory}
* @implements {nsIAbLDAPDirectory}
* @implements {nsIAbDirectory}
*/
export class LDAPDirectory extends AddrBookDirectory {
QueryInterface = ChromeUtils.generateQI([
"nsIAbLDAPDirectory",

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

@ -2,9 +2,7 @@
* 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/. */
const { LDAPListenerBase } = ChromeUtils.import(
"resource:///modules/LDAPListenerBase.jsm"
);
import { LDAPListenerBase } from "resource:///modules/LDAPListenerBase.sys.mjs";
/**
* Convert a nsIAbBooleanExpression to a filter string.

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

@ -3,12 +3,10 @@
* 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/. */
const EXPORTED_SYMBOLS = ["LDAPListenerBase"];
/**
* @implements {nsILDAPMessageListener}
*/
class LDAPListenerBase {
export class LDAPListenerBase {
/**
* @see nsILDAPMessageListener
*/

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

@ -2,15 +2,7 @@
* 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/. */
const EXPORTED_SYMBOLS = [
"AbandonRequest",
"BindRequest",
"UnbindRequest",
"SearchRequest",
"LDAPResponse",
];
var { asn1js } = ChromeUtils.importESModule("resource:///modules/asn1js.mjs");
import { asn1js } from "resource:///modules/asn1js.mjs";
/**
* A base class for all LDAP request and response messages, see
@ -76,7 +68,7 @@ class LDAPMessage {
}
}
class BindRequest extends LDAPMessage {
export class BindRequest extends LDAPMessage {
static APPLICATION = 0;
AUTH_SIMPLE = 0;
@ -127,7 +119,7 @@ class BindRequest extends LDAPMessage {
}
}
class UnbindRequest extends LDAPMessage {
export class UnbindRequest extends LDAPMessage {
static APPLICATION = 2;
protocolOp = new asn1js.Primitive({
@ -136,7 +128,7 @@ class UnbindRequest extends LDAPMessage {
});
}
class SearchRequest extends LDAPMessage {
export class SearchRequest extends LDAPMessage {
static APPLICATION = 3;
// Filter CHOICE.
@ -465,7 +457,7 @@ class SearchRequest extends LDAPMessage {
}
}
class AbandonRequest extends LDAPMessage {
export class AbandonRequest extends LDAPMessage {
static APPLICATION = 16;
/**
@ -498,7 +490,7 @@ class LDAPResult {
*
* @property {LDAPResult} result - The result of a response.
*/
class LDAPResponse extends LDAPMessage {
export class LDAPResponse extends LDAPMessage {
/**
* @param {number} messageId - The message id.
* @param {LocalBaseBlock} protocolOp - The message content.

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

@ -4,11 +4,9 @@
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"LDAPClient",
"resource:///modules/LDAPClient.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
LDAPClient: "resource:///modules/LDAPClient.sys.mjs",
});
/**
* A module to manage LDAP operation.

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

@ -3,9 +3,8 @@
* 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/. */
const { LDAPListenerBase } = ChromeUtils.import(
"resource:///modules/LDAPListenerBase.jsm"
);
import { LDAPListenerBase } from "resource:///modules/LDAPListenerBase.sys.mjs";
import { SQLiteDirectory } from "resource:///modules/SQLiteDirectory.sys.mjs";
/**

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

@ -2,8 +2,6 @@
* 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/. */
const EXPORTED_SYMBOLS = ["QueryStringToExpression"];
/**
* A module to parse a query string to a nsIAbBooleanExpression. A valid query
* string is in this form:
@ -20,7 +18,7 @@ const EXPORTED_SYMBOLS = ["QueryStringToExpression"];
* The value must be URL encoded by the caller, if it contains any
* special characters including '(' and ')'.
*/
var QueryStringToExpression = {
export var QueryStringToExpression = {
/**
* Convert a query string to a nsIAbBooleanExpression.
*

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

@ -2,21 +2,13 @@
* 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/. */
const { AddrBookDirectory } = ChromeUtils.import(
"resource:///modules/AddrBookDirectory.jsm"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
import { AddrBookDirectory } from "resource:///modules/AddrBookDirectory.sys.mjs";
import { AsyncShutdown } from "resource://gre/modules/AsyncShutdown.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
newUID: "resource:///modules/AddrBookUtils.jsm",
newUID: "resource:///modules/AddrBookUtils.sys.mjs",
});
var log = console.createInstance({

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

@ -4,24 +4,24 @@
EXTRA_JS_MODULES += [
"AddrBookCard.sys.mjs",
"AddrBookDirectory.jsm",
"AddrBookMailingList.jsm",
"AddrBookDirectory.sys.mjs",
"AddrBookMailingList.sys.mjs",
"AddrBookManager.sys.mjs",
"AddrBookUtils.jsm",
"AddrBookUtils.sys.mjs",
"CardDAVDirectory.sys.mjs",
"CardDAVUtils.jsm",
"LDAPClient.jsm",
"CardDAVUtils.sys.mjs",
"LDAPClient.sys.mjs",
"LDAPConnection.sys.mjs",
"LDAPDirectory.sys.mjs",
"LDAPDirectoryQuery.sys.mjs",
"LDAPListenerBase.jsm",
"LDAPMessage.jsm",
"LDAPListenerBase.sys.mjs",
"LDAPMessage.sys.mjs",
"LDAPOperation.sys.mjs",
"LDAPProtocolHandler.sys.mjs",
"LDAPReplicationService.sys.mjs",
"LDAPService.sys.mjs",
"LDAPURLParser.sys.mjs",
"QueryStringToExpression.jsm",
"QueryStringToExpression.sys.mjs",
"SQLiteDirectory.sys.mjs",
"VCardUtils.sys.mjs",
]

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

@ -3,11 +3,11 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { isLegalHostNameOrIP, cleanUpHostName } = ChromeUtils.import(
"resource:///modules/hostnameUtils.jsm"
var { isLegalHostNameOrIP, cleanUpHostName } = ChromeUtils.importESModule(
"resource:///modules/hostnameUtils.sys.mjs"
);
var gCurrentDirectory = null;

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

@ -4,8 +4,8 @@
/* import-globals-from ../../../../mail/components/addrbook/content/abCommon.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
window.addEventListener("DOMContentLoaded", onInitEditDirectories);

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

@ -2,9 +2,7 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
export function AbAutoCompleteMyDomain() {}

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

@ -2,15 +2,14 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var {
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
import {
getSearchTokens,
getModelQuery,
modelQueryHasUserValue,
generateQueryURI,
} = ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
} from "resource:///modules/ABQueryUtils.sys.mjs";
var ACR = Ci.nsIAutoCompleteResult;

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

@ -2,9 +2,7 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
var ACR = Ci.nsIAutoCompleteResult;

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

@ -2,8 +2,6 @@
* 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/. */
const EXPORTED_SYMBOLS = ["CardDAVServer"];
const PREFIX_BINDINGS = {
card: "urn:ietf:params:xml:ns:carddav",
cs: "http://calendarserver.org/ns/",
@ -13,17 +11,11 @@ const NAMESPACE_STRING = Object.entries(PREFIX_BINDINGS)
.map(([prefix, url]) => `xmlns:${prefix}="${url}"`)
.join(" ");
const { Assert } = ChromeUtils.importESModule(
"resource://testing-common/Assert.sys.mjs"
);
const { CommonUtils } = ChromeUtils.importESModule(
"resource://services-common/utils.sys.mjs"
);
const { HttpServer } = ChromeUtils.importESModule(
"resource://testing-common/httpd.sys.mjs"
);
import { Assert } from "resource://testing-common/Assert.sys.mjs";
import { CommonUtils } from "resource://services-common/utils.sys.mjs";
import { HttpServer } from "resource://testing-common/httpd.sys.mjs";
var CardDAVServer = {
export var CardDAVServer = {
books: {
"/addressbooks/me/default/": "Not This One",
"/addressbooks/me/test/": "CardDAV Test",

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

@ -2,12 +2,9 @@
* 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/. */
const EXPORTED_SYMBOLS = ["LDAPServer"];
const PRINT_DEBUG = false;
const { Assert } = ChromeUtils.importESModule(
"resource://testing-common/Assert.sys.mjs"
);
import { Assert } from "resource://testing-common/Assert.sys.mjs";
/**
* This is a partial implementation of an LDAP server as defined by RFC 4511.
@ -19,7 +16,7 @@ const { Assert } = ChromeUtils.importESModule(
* @implements {nsIInputStreamCallback}
* @implements {nsIServerSocketListener}
*/
var LDAPServer = {
export var LDAPServer = {
BindRequest: 0x60,
UnbindRequest: 0x42,
SearchRequest: 0x63,

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

@ -4,8 +4,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
TESTING_JS_MODULES += [
"CardDAVServer.jsm",
"LDAPServer.jsm",
"CardDAVServer.sys.mjs",
"LDAPServer.sys.mjs",
]
XPCSHELL_TESTS_MANIFESTS += [

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { TestUtils } = ChromeUtils.importESModule(
"resource://testing-common/TestUtils.sys.mjs"

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

@ -5,8 +5,8 @@
const { CardDAVDirectory } = ChromeUtils.importESModule(
"resource:///modules/CardDAVDirectory.sys.mjs"
);
const { CardDAVServer } = ChromeUtils.import(
"resource://testing-common/CardDAVServer.jsm"
const { CardDAVServer } = ChromeUtils.importESModule(
"resource://testing-common/CardDAVServer.sys.mjs"
);
const { TestUtils } = ChromeUtils.importESModule(
"resource://testing-common/TestUtils.sys.mjs"

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

@ -9,8 +9,8 @@
var { CommonUtils } = ChromeUtils.importESModule(
"resource://services-common/utils.sys.mjs"
);
var { LDAPResponse, SearchRequest } = ChromeUtils.import(
"resource:///modules/LDAPMessage.jsm"
var { LDAPResponse, SearchRequest } = ChromeUtils.importESModule(
"resource:///modules/LDAPMessage.sys.mjs"
);
/**

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
const vCardTemplate =

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

@ -4,8 +4,8 @@
"use strict";
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
function getExistingDirectories() {

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

@ -7,14 +7,14 @@
var { AddrBookCard } = ChromeUtils.importESModule(
"resource:///modules/AddrBookCard.sys.mjs"
);
var { AddrBookUtils } = ChromeUtils.import(
"resource:///modules/AddrBookUtils.jsm"
var { AddrBookUtils } = ChromeUtils.importESModule(
"resource:///modules/AddrBookUtils.sys.mjs"
);
var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { VCardPropertyEntry } = ChromeUtils.importESModule(
"resource:///modules/VCardUtils.sys.mjs"

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

@ -7,8 +7,8 @@
var FILE_NAME = "abook-1.sqlite";
var SCHEME = "jsaddrbook";
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"

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

@ -2,8 +2,8 @@
* 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/. */
const { LDAPServer } = ChromeUtils.import(
"resource://testing-common/LDAPServer.jsm"
const { LDAPServer } = ChromeUtils.importESModule(
"resource://testing-common/LDAPServer.sys.mjs"
);
const autocompleteService = Cc[

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

@ -8,8 +8,8 @@
* books.
*/
var { getModelQuery } = ChromeUtils.import(
"resource:///modules/ABQueryUtils.jsm"
var { getModelQuery } = ChromeUtils.importESModule(
"resource:///modules/ABQueryUtils.sys.mjs"
);
// taken from nsAbAutoCompleteSearch.js

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

@ -4,8 +4,8 @@
"use strict";
const { getModelQuery, generateQueryURI } = ChromeUtils.import(
"resource:///modules/ABQueryUtils.jsm"
const { getModelQuery, generateQueryURI } = ChromeUtils.importESModule(
"resource:///modules/ABQueryUtils.sys.mjs"
);
const jsonFile = do_get_file("data/ldap_contacts.json");

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

@ -11,27 +11,16 @@
// Wrap in a block to prevent leaking to window scope.
{
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
const { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
const LazyModules = {};
ChromeUtils.defineModuleGetter(
LazyModules,
"FeedUtils",
"resource:///modules/FeedUtils.jsm"
);
ChromeUtils.defineModuleGetter(
LazyModules,
"FolderUtils",
"resource:///modules/FolderUtils.jsm"
);
ChromeUtils.defineModuleGetter(
LazyModules,
"MailUtils",
"resource:///modules/MailUtils.jsm"
);
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FeedUtils: "resource:///modules/FeedUtils.sys.mjs",
FolderUtils: "resource:///modules/FolderUtils.sys.mjs",
MailUtils: "resource:///modules/MailUtils.sys.mjs",
});
/**
* Creates an element, sets attributes on it, including always setting the
@ -425,7 +414,7 @@
// If we don't have a parent, then we assume we should build the
// top-level accounts. (Actually we build the fake root folders for
// those accounts.)
const accounts = LazyModules.FolderUtils.allAccountsSorted(true);
const accounts = lazy.FolderUtils.allAccountsSorted(true);
// Now generate our folder list. Note that we'll special case this
// situation elsewhere, to avoid destroying the sort order we just made.
@ -526,8 +515,7 @@
const folderURI = Services.prefs.getStringPref(
"mail.last_msg_movecopy_target_uri"
);
const folder =
folderURI && LazyModules.MailUtils.getExistingFolder(folderURI);
const folder = folderURI && lazy.MailUtils.getExistingFolder(folderURI);
if (!folder) {
return;
}
@ -565,7 +553,7 @@
switch (specialType) {
case "recent":
// Find the most recently modified ones.
specialFolders = LazyModules.FolderUtils.getMostRecentFolders(
specialFolders = lazy.FolderUtils.getMostRecentFolders(
specialFolders,
Services.prefs.getIntPref("mail.folder_widget.max_recent"),
"MRMTime"
@ -616,7 +604,7 @@
// Make sure the entries are sorted alphabetically.
specialFoldersMap.sort((a, b) =>
LazyModules.FolderUtils.folderNameCompare(a.label, b.label)
lazy.FolderUtils.folderNameCompare(a.label, b.label)
);
// Create entries for each of the recent folders.
@ -708,7 +696,7 @@
// We need to call this, or hasSubFolders will always return false.
// Remove this workaround when Bug 502900 is fixed.
LazyModules.MailUtils.discoverFolders();
lazy.MailUtils.discoverFolders();
this._serversOnly = true;
const [shouldExpand, labels] = this._getShouldExpandAndLabels();
@ -870,7 +858,7 @@
// First the SpecialFolder attribute.
attributes.SpecialFolder =
LazyModules.FolderUtils.getSpecialFolderString(folder);
lazy.FolderUtils.getSpecialFolderString(folder);
// Now the biffState.
const biffStates = ["NewMail", "NoMail", "UnknownMail"];
@ -884,8 +872,7 @@
attributes.IsServer = folder.isServer;
attributes.IsSecure = folder.server.isSecure;
attributes.ServerType = folder.server.type;
attributes.IsFeedFolder =
!!LazyModules.FeedUtils.getFeedUrlsInFolder(folder);
attributes.IsFeedFolder = !!lazy.FeedUtils.getFeedUrlsInFolder(folder);
return attributes;
}
@ -914,9 +901,7 @@
}
if (this._displayformat == "path") {
return (
LazyModules.FeedUtils.getFolderPrettyPath(folder) || folder.name
);
return lazy.FeedUtils.getFolderPrettyPath(folder) || folder.name;
}
return folder.name;
@ -967,13 +952,11 @@
);
menulist.setAttribute(
"SpecialFolder",
folder
? LazyModules.FolderUtils.getSpecialFolderString(folder)
: "none"
folder ? lazy.FolderUtils.getSpecialFolderString(folder) : "none"
);
menulist.setAttribute(
"IsFeedFolder",
Boolean(folder && LazyModules.FeedUtils.getFeedUrlsInFolder(folder))
Boolean(folder && lazy.FeedUtils.getFeedUrlsInFolder(folder))
);
}

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

@ -8,7 +8,9 @@
var { FolderTreeProperties } = ChromeUtils.importESModule(
"resource:///modules/FolderTreeProperties.sys.mjs"
);
var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var { Gloda } = ChromeUtils.importESModule(
"resource:///modules/gloda/Gloda.sys.mjs"
);
var gMsgFolder;
var gLockedPref = null;

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

@ -17,17 +17,15 @@
/* globals gDBView, gViewWrapper */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
ChromeUtils.defineModuleGetter(
this,
"MailUtils",
"resource:///modules/MailUtils.jsm"
);
ChromeUtils.defineESModuleGetters(this, {
MailUtils: "resource:///modules/MailUtils.sys.mjs",
});
/**
* Determines the actions that should be carried out on the messages

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

@ -3,8 +3,8 @@
* 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/. */
var { MailE10SUtils } = ChromeUtils.import(
"resource:///modules/MailE10SUtils.jsm"
var { MailE10SUtils } = ChromeUtils.importESModule(
"resource:///modules/MailE10SUtils.sys.mjs"
);
var gLogView;

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

@ -3,10 +3,12 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
ChromeUtils.defineESModuleGetters(this, {
UIDensity: "resource:///modules/UIDensity.sys.mjs",

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

@ -7,13 +7,13 @@
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
XPCOMUtils.defineLazyModuleGetters(this, {
FolderUtils: "resource:///modules/FolderUtils.jsm",
MailUtils: "resource:///modules/MailUtils.jsm",
ChromeUtils.defineESModuleGetters(this, {
FolderUtils: "resource:///modules/FolderUtils.sys.mjs",
MailUtils: "resource:///modules/MailUtils.sys.mjs",
});
var gFolderTreeView = new PROTO_TREE_VIEW();

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

@ -2,7 +2,9 @@
* 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/. */
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var gSynchronizeTree = null;
var gParentMsgWindow;

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

@ -4,7 +4,9 @@
/* globals msgWindow, nsMsgStatusFeedback */ // From mailWindow.js
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var gSubscribeTree = null;
var gSubscribeBody = null;

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

@ -7,13 +7,13 @@
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
XPCOMUtils.defineLazyModuleGetters(this, {
FolderUtils: "resource:///modules/FolderUtils.jsm",
MailUtils: "resource:///modules/MailUtils.jsm",
ChromeUtils.defineESModuleGetters(this, {
FolderUtils: "resource:///modules/FolderUtils.sys.mjs",
MailUtils: "resource:///modules/MailUtils.sys.mjs",
});
window.addEventListener("DOMContentLoaded", () => {

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

@ -17,16 +17,20 @@ var gMsgFolder;
var { FolderTreeProperties } = ChromeUtils.importESModule(
"resource:///modules/FolderTreeProperties.sys.mjs"
);
var { FolderUtils } = ChromeUtils.import("resource:///modules/FolderUtils.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { FolderUtils } = ChromeUtils.importESModule(
"resource:///modules/FolderUtils.sys.mjs"
);
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { PluralForm } = ChromeUtils.importESModule(
"resource:///modules/PluralForm.sys.mjs"
);
var { VirtualFolderHelper } = ChromeUtils.import(
"resource:///modules/VirtualFolderWrapper.jsm"
var { VirtualFolderHelper } = ChromeUtils.importESModule(
"resource:///modules/VirtualFolderWrapper.sys.mjs"
);
window.addEventListener("DOMContentLoaded", onLoad);

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

@ -32,24 +32,24 @@
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var { Gloda } = ChromeUtils.importESModule(
"resource:///modules/gloda/Gloda.sys.mjs"
);
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
ChromeUtils.defineESModuleGetters(this, {
FolderUtils: "resource:///modules/FolderUtils.sys.mjs",
UIDensity: "resource:///modules/UIDensity.sys.mjs",
UIFontSize: "resource:///modules/UIFontSize.sys.mjs",
});
ChromeUtils.defineModuleGetter(
this,
"FolderUtils",
"resource:///modules/FolderUtils.jsm"
);
var { cleanUpHostName, isLegalHostNameOrIP } = ChromeUtils.import(
"resource:///modules/hostnameUtils.jsm"
var { cleanUpHostName, isLegalHostNameOrIP } = ChromeUtils.importESModule(
"resource:///modules/hostnameUtils.sys.mjs"
);
var { ChatIcons } = ChromeUtils.importESModule(
"resource:///modules/chatIcons.sys.mjs"

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

@ -24,10 +24,12 @@
* account -> accountData -> pageData -> accountData -> finishAccount
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { NntpUtils } = ChromeUtils.importESModule(
"resource:///modules/NntpUtils.sys.mjs"
);
var { NntpUtils } = ChromeUtils.import("resource:///modules/NntpUtils.jsm");
var contentWindow;

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

@ -2,14 +2,14 @@
* 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/. */
var { cleanUpHostName, isLegalHostNameOrIP } = ChromeUtils.import(
"resource:///modules/hostnameUtils.jsm"
var { cleanUpHostName, isLegalHostNameOrIP } = ChromeUtils.importESModule(
"resource:///modules/hostnameUtils.sys.mjs"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { OAuth2Providers } = ChromeUtils.import(
"resource:///modules/OAuth2Providers.jsm"
var { OAuth2Providers } = ChromeUtils.importESModule(
"resource:///modules/OAuth2Providers.sys.mjs"
);
var gSmtpServer;

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

@ -7,8 +7,8 @@
/* globals SelectFolder */ // From messageWindow.js or messenger.js.
/* globals MsgGetMessage */ // From mailWindowOverlay.js.
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var gAnyValidIdentity = false; // If there are no valid identities for any account

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

@ -5,7 +5,9 @@
/* import-globals-from am-prefs.js */
/* import-globals-from amUtils.js */
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var gFccRadioElemChoice,
gDraftsRadioElemChoice,

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

@ -2,7 +2,9 @@
* 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/. */
var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var { Gloda } = ChromeUtils.importESModule(
"resource:///modules/gloda/Gloda.sys.mjs"
);
var gIdentityListBox; // the root <richlistbox> node
var gAddButton;

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

@ -6,8 +6,8 @@
/* import-globals-from am-copies.js */
/* import-globals-from ../../../../mail/extensions/am-e2e/am-e2e.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var gIdentity = null; // the identity we are editing (may be null for a new identity)

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

@ -5,10 +5,12 @@
/* import-globals-from am-prefs.js */
/* import-globals-from amUtils.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var gDeferredToAccount = "";

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
window.addEventListener("DOMContentLoaded", onLoad);

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

@ -5,7 +5,9 @@
/* import-globals-from am-prefs.js */
/* import-globals-from amUtils.js */
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var gServer;
var gOriginalStoreType;

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

@ -2,7 +2,9 @@
* 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/. */
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var gAccount;
var gOriginalStoreType;

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

@ -4,8 +4,8 @@
/* import-globals-from amUtils.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
window.addEventListener("DOMContentLoaded", event => {

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

@ -5,10 +5,12 @@
/* import-globals-from am-smtp.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
function BrowseForLocalFolders() {
var currentFolderTextBox = document.getElementById("server.localPath");

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

@ -5,8 +5,8 @@
/* import-globals-from AccountWizard.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
function donePageInit() {

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

@ -5,10 +5,12 @@
/* import-globals-from AccountWizard.js */
var { cleanUpHostName, isLegalHostNameOrIP } = ChromeUtils.import(
"resource:///modules/hostnameUtils.jsm"
var { cleanUpHostName, isLegalHostNameOrIP } = ChromeUtils.importESModule(
"resource:///modules/hostnameUtils.sys.mjs"
);
var { NntpUtils } = ChromeUtils.importESModule(
"resource:///modules/NntpUtils.sys.mjs"
);
var { NntpUtils } = ChromeUtils.import("resource:///modules/NntpUtils.jsm");
function incomingPageValidate() {
const hostName = cleanUpHostName(document.getElementById("newsServer").value);

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

@ -7,17 +7,17 @@
* type conversion.
*/
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { MailUtils } = ChromeUtils.importESModule(
"resource:///modules/MailUtils.sys.mjs"
);
var { FileUtils } = ChromeUtils.importESModule(
"resource://gre/modules/FileUtils.sys.mjs"
);
ChromeUtils.defineModuleGetter(
this,
"FolderUtils",
"resource:///modules/FolderUtils.jsm"
);
var MailstoreConverter = ChromeUtils.import(
"resource:///modules/mailstoreConverter.jsm"
ChromeUtils.defineESModuleGetters(this, {
FolderUtils: "resource:///modules/FolderUtils.sys.mjs",
});
var MailstoreConverter = ChromeUtils.importESModule(
"resource:///modules/mailstoreConverter.sys.mjs"
);
var { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var gServer;

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

@ -6,14 +6,6 @@
* This file contains helper methods for dealing with addressbook search URIs.
*/
const EXPORTED_SYMBOLS = [
"getSearchTokens",
"getModelQuery",
"modelQueryHasUserValue",
"generateQueryURI",
"encodeABTermValue",
];
/**
* Parse the multiword search string to extract individual search terms
* (separated on the basis of spaces) or quoted exact phrases to search
@ -23,7 +15,7 @@ const EXPORTED_SYMBOLS = [
*
* @returns {Array} Array of separated search terms from the full search string.
*/
function getSearchTokens(aSearchString) {
export function getSearchTokens(aSearchString) {
// Trim leading and trailing whitespace and comma(s) to prevent empty search
// words when splitting unquoted parts of search string below.
let searchString = aSearchString
@ -78,7 +70,7 @@ function getSearchTokens(aSearchString) {
* @returns {boolean} depending on mail.addr_book.show_phonetic_fields pref,
* the value of aBasePrefName or aBasePrefName + ".phonetic"
*/
function getModelQuery(aBasePrefName) {
export function getModelQuery(aBasePrefName) {
let modelQuery = "";
if (
Services.prefs.getComplexValue(
@ -107,7 +99,7 @@ function getModelQuery(aBasePrefName) {
* e.g. mail.addr_book.quicksearchquery.format.phonetic
* @returns {boolean} true or false
*/
function modelQueryHasUserValue(aBasePrefName) {
export function modelQueryHasUserValue(aBasePrefName) {
if (
Services.prefs.getComplexValue(
"mail.addr_book.show_phonetic_fields",
@ -128,7 +120,7 @@ function modelQueryHasUserValue(aBasePrefName) {
*
* @return query URI.
*/
function generateQueryURI(aModelQuery, aSearchWords) {
export function generateQueryURI(aModelQuery, aSearchWords) {
// If there are no search tokens, we simply return an empty string.
if (!aSearchWords || aSearchWords.length == 0) {
return "";
@ -152,7 +144,7 @@ function generateQueryURI(aModelQuery, aSearchWords) {
* search query language, but are not escaped in encodeURIComponent()
* so must be done manually on top of it.
*/
function encodeABTermValue(aString) {
export function encodeABTermValue(aString) {
return encodeURIComponent(aString)
.replace(/\(/g, "%28")
.replace(/\)/g, "%29");

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

@ -6,9 +6,7 @@
* This file contains helper methods for dealing with nsIMsgFolders.
*/
const EXPORTED_SYMBOLS = ["FolderUtils"];
var FolderUtils = {
export var FolderUtils = {
allAccountsSorted,
compareAccounts,
folderNameCompare,
@ -21,9 +19,7 @@ var FolderUtils = {
isSmartVirtualFolder,
};
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
/**
* Returns a string representation of a folder's "special" type.

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

@ -4,9 +4,7 @@
// This is a modification of the JXON parsers found on the page
// <https://developer.mozilla.org/en-US/docs/JXON>
var EXPORTED_SYMBOLS = ["JXON"];
var JXON = new (function () {
export var JXON = new (function () {
const sValueProp = "value"; /* you can customize these values */
const sAttributesProp = "attr";
const sAttrPref = "@";

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

@ -2,8 +2,6 @@
* 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/. */
const EXPORTED_SYMBOLS = ["LineReader"];
/**
* For certain requests, mail servers return a multi-line response that are
* handled by this class. The definitions of multi-line responses can be found
@ -21,7 +19,7 @@ const EXPORTED_SYMBOLS = ["LineReader"];
* - Passing each line to a processing function, lineCallback.
* - Calling a finalization function, doneCallback, when all lines are processed
*/
class LineReader {
export class LineReader {
// Goes true only when more than one call to read() occurs to handle the
// complete multi-line response. Used by NNTP and POP3 response parsers.
receivingMultiLineResponse = false;

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

@ -2,19 +2,9 @@
* 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/. */
const EXPORTED_SYMBOLS = [
"SmtpAuthenticator",
"NntpAuthenticator",
"Pop3Authenticator",
"ImapAuthenticator",
];
import { MailCryptoUtils } from "resource:///modules/MailCryptoUtils.sys.mjs";
var { MailCryptoUtils } = ChromeUtils.import(
"resource:///modules/MailCryptoUtils.jsm"
);
var { MailStringUtils } = ChromeUtils.import(
"resource:///modules/MailStringUtils.jsm"
);
import { MailStringUtils } from "resource:///modules/MailStringUtils.sys.mjs";
/**
* A base class for interfaces when authenticating a mail connection.
@ -218,7 +208,7 @@ class MailAuthenticator {
*
* @augments {MailAuthenticator}
*/
class SmtpAuthenticator extends MailAuthenticator {
export class SmtpAuthenticator extends MailAuthenticator {
/**
* @param {nsISmtpServer} server - The associated server instance.
*/
@ -390,7 +380,7 @@ class IncomingServerAuthenticator extends MailAuthenticator {
*
* @augments {IncomingServerAuthenticator}
*/
class NntpAuthenticator extends IncomingServerAuthenticator {
export class NntpAuthenticator extends IncomingServerAuthenticator {
/**
* @returns {string} - NNTP server has no userName pref, need to pass it in.
*/
@ -408,7 +398,7 @@ class NntpAuthenticator extends IncomingServerAuthenticator {
*
* @augments {IncomingServerAuthenticator}
*/
class Pop3Authenticator extends IncomingServerAuthenticator {
export class Pop3Authenticator extends IncomingServerAuthenticator {
async getPassword() {
if (this._server.password) {
return this._server.password;
@ -437,7 +427,7 @@ class Pop3Authenticator extends IncomingServerAuthenticator {
*
* @augments {IncomingServerAuthenticator}
*/
class ImapAuthenticator extends IncomingServerAuthenticator {
export class ImapAuthenticator extends IncomingServerAuthenticator {
async getPassword() {
if (this._server.password) {
return this._server.password;

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

@ -2,9 +2,7 @@
* 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/. */
const EXPORTED_SYMBOLS = ["MailCryptoUtils"];
var MailCryptoUtils = {
export var MailCryptoUtils = {
/**
* Converts a binary string into a Uint8Array.
*

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

@ -3,19 +3,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
MailUtils: "resource:///modules/MailUtils.jsm",
WinUnreadBadge: "resource:///modules/WinUnreadBadge.jsm",
ChromeUtils.defineESModuleGetters(lazy, {
MailUtils: "resource:///modules/MailUtils.sys.mjs",
WinUnreadBadge: "resource:///modules/WinUnreadBadge.sys.mjs",
});
ChromeUtils.defineLazyGetter(
lazy,
"l10n",

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

@ -8,9 +8,7 @@
* information to platform-specific notification modules.
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
/**
* NewMailNotificationService.

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

@ -2,13 +2,9 @@
* 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/. */
var EXPORTED_SYMBOLS = ["MailServices"];
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
var MailServices = {
export var MailServices = {
/**
* Gets the `nsIMsgMessageService` for a given message URI. This should have
* the same behaviour as `GetMessageServiceFromURI` (nsMsgUtils.cpp).

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

@ -2,9 +2,7 @@
* 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/. */
const EXPORTED_SYMBOLS = ["MailStringUtils"];
var MailStringUtils = {
export var MailStringUtils = {
/**
* Convert a ByteString to a Uint8Array.
*

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

@ -10,16 +10,12 @@
* or was never used in the old version.
*/
const EXPORTED_SYMBOLS = ["migrateMailnews"];
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"migrateServerUris",
"resource:///modules/MsgIncomingServer.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
migrateServerUris: "resource:///modules/MsgIncomingServer.sys.mjs",
});
function migrateMailnews() {
export function migrateMailnews() {
const migrations = [migrateServerAndUserName];
for (const fn of migrations) {

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

@ -8,11 +8,7 @@
/* :::::::: Constants and Helpers ::::::::::::::: */
const EXPORTED_SYMBOLS = ["msgDBCacheManager"];
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
var log = console.createInstance({
prefix: "mailnews.database.dbcache",
@ -26,7 +22,7 @@ var DBCACHE_INTERVAL_DEFAULT_MS = 60000; // 1 minute
/* :::::::: The Module ::::::::::::::: */
var msgDBCacheManager = {
export var msgDBCacheManager = {
_initialized: false,
_msgDBCacheTimer: null,

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

@ -2,11 +2,7 @@
* 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/. */
const EXPORTED_SYMBOLS = ["migrateServerUris", "MsgIncomingServer"];
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
/**
* When hostname/username changes, update the corresponding entry in
@ -158,7 +154,7 @@ function migrateFilters(oldServerUri, newServerUri) {
* @param {string} newHostname - The hostname after the change.
* @param {string} newUsername - The username after the change.
*/
function migrateServerUris(
export function migrateServerUris(
localStoreType,
oldHostname,
oldUsername,
@ -214,7 +210,7 @@ function migrateServerUris(
* @implements {nsIObserver}
* @abstract
*/
class MsgIncomingServer {
export class MsgIncomingServer {
QueryInterface = ChromeUtils.generateQI([
"nsIMsgIncomingServer",
"nsISupportsWeakReference",

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

@ -2,8 +2,6 @@
* 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/. */
const EXPORTED_SYMBOLS = ["MsgKeySet"];
/**
* A structure to represent a set of articles. This is usually for lines from
* the newsrc, which have article lists like
@ -17,7 +15,7 @@ const EXPORTED_SYMBOLS = ["MsgKeySet"];
* - gaps in the set are usually small, but not always
* - consecutive ranges tend to be large
*/
class MsgKeySet {
export class MsgKeySet {
/**
* @param {string} [str] - The raw string to represent a set of articles.
*/

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

@ -7,11 +7,7 @@
*
* @see RFC 6749
*/
var EXPORTED_SYMBOLS = ["OAuth2"];
var { CryptoUtils } = ChromeUtils.importESModule(
"resource://services-crypto/utils.sys.mjs"
);
import { CryptoUtils } from "resource://services-crypto/utils.sys.mjs";
// Only allow one connecting window per endpoint.
var gConnecting = {};
@ -36,7 +32,7 @@ var gConnecting = {};
* @param {string} issuerDetails.tokenEndpoint - The token endpoint as defined
* by RFC 6749 Section 3.2.
*/
function OAuth2(scope, issuerDetails) {
export function OAuth2(scope, issuerDetails) {
this.scope = scope;
this.authorizationEndpoint = issuerDetails.authorizationEndpoint;
this.clientId = issuerDetails.clientId;

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

@ -2,10 +2,9 @@
* 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/. */
var { OAuth2 } = ChromeUtils.import("resource:///modules/OAuth2.jsm");
var { OAuth2Providers } = ChromeUtils.import(
"resource:///modules/OAuth2Providers.jsm"
);
import { OAuth2 } from "resource:///modules/OAuth2.sys.mjs";
import { OAuth2Providers } from "resource:///modules/OAuth2Providers.sys.mjs";
/**
* A collection of `OAuth2` objects that have previously been created.

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

@ -5,8 +5,6 @@
/**
* Details of supported OAuth2 Providers.
*/
var EXPORTED_SYMBOLS = ["OAuth2Providers"];
// When we add a Google mail account, ask for address book and calendar scopes
// as well. Then we can add an address book or calendar without asking again.
//
@ -194,7 +192,7 @@ var kIssuers = new Map([
* OAuth2Providers: Methods to lookup OAuth2 parameters for supported OAuth2
* providers.
*/
var OAuth2Providers = {
export var OAuth2Providers = {
/**
* Map a hostname to the relevant issuer and scope.
*

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

@ -2,13 +2,9 @@
* 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/. */
var EXPORTED_SYMBOLS = ["PluralStringFormatter", "makeFriendlyDateAgo"];
import { PluralForm } from "resource:///modules/PluralForm.sys.mjs";
var { PluralForm } = ChromeUtils.importESModule(
"resource:///modules/PluralForm.sys.mjs"
);
function PluralStringFormatter(aBundleURI) {
export function PluralStringFormatter(aBundleURI) {
this._bundle = Services.strings.createBundle(aBundleURI);
}
@ -56,7 +52,7 @@ const _weekdayFormatter = new Services.intl.DateTimeFormat(undefined, {
* @returns {string} A "human-friendly" representation of that time
* relative to now.
*/
function makeFriendlyDateAgo(time) {
export function makeFriendlyDateAgo(time) {
// TODO: use Intl.RelativeTimeFormat instead.
// Figure out when today begins
const now = new Date();

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

@ -6,13 +6,9 @@
* Wrap everything about virtual folders.
*/
const EXPORTED_SYMBOLS = ["VirtualFolderHelper"];
import { MailServices } from "resource:///modules/MailServices.sys.mjs";
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var VirtualFolderHelper = {
export var VirtualFolderHelper = {
/**
* Create a new virtual folder (an actual nsIMsgFolder that did not previously
* exist), wrapping it in a VirtualFolderWrapper, and returning that wrapper.

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

@ -7,11 +7,7 @@
* Copyright (c) 2013-2020 Brandon Streiff
*/
const EXPORTED_SYMBOLS = ["WinUnreadBadge"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
@ -187,7 +183,7 @@ function downsampleBy4X(window, canvas) {
/**
* A module to manage the unread badge icon on Windows.
*/
var WinUnreadBadge = {
export var WinUnreadBadge = {
/**
* Keeping an instance of nsITaskbarOverlayIconController alive
* to show a taskbar icon after the updateUnreadCount method exits.

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

@ -7,20 +7,9 @@
* Generic shared utility code for checking of IP and hostname validity.
*/
const EXPORTED_SYMBOLS = [
"isLegalHostNameOrIP",
"isLegalHostName",
"isLegalIPv4Address",
"isLegalIPv6Address",
"isLegalIPAddress",
"isLegalLocalIPAddress",
"cleanUpHostName",
"kMinPort",
"kMaxPort",
];
export var kMinPort = 1;
var kMinPort = 1;
var kMaxPort = 65535;
export var kMaxPort = 65535;
/**
* Check if aHostName is an IP address or a valid hostname.
@ -30,7 +19,7 @@ var kMaxPort = 65535;
* @returns {?string} Unobscured host name if aHostName is valid.
* Returns null if it's not.
*/
function isLegalHostNameOrIP(aHostName, aAllowExtendedIPFormats) {
export function isLegalHostNameOrIP(aHostName, aAllowExtendedIPFormats) {
/*
RFC 1123:
Whenever a user inputs the identity of an Internet host, it SHOULD
@ -51,7 +40,7 @@ function isLegalHostNameOrIP(aHostName, aAllowExtendedIPFormats) {
*
* @returns {?string} The host name if it is valid. Returns null if it's not.
*/
function isLegalHostName(aHostName) {
export function isLegalHostName(aHostName) {
/*
RFC 952:
A "name" (Net, Host, Gateway, or Domain name) is a text string up
@ -105,7 +94,7 @@ function isLegalHostName(aHostName) {
* @returns {string} Unobscured canonicalized address if aHostName is an
* IPv4 address. Returns null if it's not.
*/
function isLegalIPv4Address(aHostName, aAllowExtendedIPFormats) {
export function isLegalIPv4Address(aHostName, aAllowExtendedIPFormats) {
// Scammers frequently obscure the IP address by encoding each component as
// decimal, octal, hex or in some cases a mix match of each. There can even
// be less than 4 components where the last number covers the missing components.
@ -193,7 +182,7 @@ function isLegalIPv4Address(aHostName, aAllowExtendedIPFormats) {
* @returns {string} Unobscured canonicalized address if aHostName is an
* IPv6 address. Returns null if it's not.
*/
function isLegalIPv6Address(aHostName) {
export function isLegalIPv6Address(aHostName) {
if (!aHostName) {
return null;
}
@ -290,7 +279,7 @@ function isLegalIPv6Address(aHostName) {
* @returns {?string} Unobscured canonicalized IPv4 or IPv6 address if it is
* valid, otherwise null.
*/
function isLegalIPAddress(aHostName, aAllowExtendedIPFormats) {
export function isLegalIPAddress(aHostName, aAllowExtendedIPFormats) {
return (
isLegalIPv4Address(aHostName, aAllowExtendedIPFormats) ||
isLegalIPv6Address(aHostName)
@ -306,7 +295,7 @@ function isLegalIPAddress(aHostName, aAllowExtendedIPFormats) {
* (unobscured) form.
* @returns {boolean} frue if it is a local/private IPv4 or IPv6 address.
*/
function isLegalLocalIPAddress(aIPAddress) {
export function isLegalLocalIPAddress(aIPAddress) {
// IPv4 address?
let ipComponents = aIPAddress.split(".");
if (ipComponents.length == 4) {
@ -362,7 +351,7 @@ function isLegalLocalIPAddress(aIPAddress) {
*
* @param {string} aHostName - The hostname or IP string to clean up.
*/
function cleanUpHostName(aHostName) {
export function cleanUpHostName(aHostName) {
// TODO: Bug 235312: if UTF8 string was input, convert to punycode using convertUTF8toACE()
// but bug 563172 needs resolving first.
return aHostName.trim();

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

@ -2,11 +2,7 @@
* 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/. */
var EXPORTED_SYMBOLS = ["convertMailStoreTo", "terminateWorkers"];
const { FileUtils } = ChromeUtils.importESModule(
"resource://gre/modules/FileUtils.sys.mjs"
);
import { FileUtils } from "resource://gre/modules/FileUtils.sys.mjs";
const log = console.createInstance({
prefix: "mail.mailstoreconverter",
@ -28,7 +24,11 @@ let gConverterWorker = null;
* directory for the migrated server.
* Rejects with an error message.
*/
function convertMailStoreTo(aMailstoreContractId, aServer, aEventTarget) {
export function convertMailStoreTo(
aMailstoreContractId,
aServer,
aEventTarget
) {
const accountRootFolder = aServer.rootFolder.filePath;
let srcType = null;
@ -330,7 +330,7 @@ function installNewRoot(server, dir, newStoreTypeID) {
/**
* Terminate any workers involved in the conversion process.
*/
function terminateWorkers() {
export function terminateWorkers() {
// We're only using a single worker right now.
if (gConverterWorker !== null) {
gConverterWorker.terminate();

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

@ -110,33 +110,33 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
]
EXTRA_JS_MODULES += [
"ABQueryUtils.jsm",
"ABQueryUtils.sys.mjs",
"converterWorker.js",
"FolderLookupService.sys.mjs",
"FolderUtils.jsm",
"hostnameUtils.jsm",
"JXON.jsm",
"LineReader.jsm",
"MailAuthenticator.jsm",
"FolderUtils.sys.mjs",
"hostnameUtils.sys.mjs",
"JXON.sys.mjs",
"LineReader.sys.mjs",
"MailAuthenticator.sys.mjs",
"MailChannel.sys.mjs",
"MailCryptoUtils.jsm",
"MailnewsMigrator.jsm",
"MailCryptoUtils.sys.mjs",
"MailnewsMigrator.sys.mjs",
"MailNotificationManager.sys.mjs",
"MailNotificationService.sys.mjs",
"MailServices.jsm",
"mailstoreConverter.jsm",
"MailStringUtils.jsm",
"MailServices.sys.mjs",
"mailstoreConverter.sys.mjs",
"MailStringUtils.sys.mjs",
"MsgAsyncPrompter.sys.mjs",
"MsgDBCacheManager.jsm",
"MsgIncomingServer.jsm",
"MsgKeySet.jsm",
"MsgDBCacheManager.sys.mjs",
"MsgIncomingServer.sys.mjs",
"MsgKeySet.sys.mjs",
"MsgProtocolInfo.sys.mjs",
"OAuth2.jsm",
"OAuth2.sys.mjs",
"OAuth2Module.sys.mjs",
"OAuth2Providers.jsm",
"TemplateUtils.jsm",
"VirtualFolderWrapper.jsm",
"WinUnreadBadge.jsm",
"OAuth2Providers.sys.mjs",
"TemplateUtils.sys.mjs",
"VirtualFolderWrapper.sys.mjs",
"WinUnreadBadge.sys.mjs",
]
USE_LIBS += [

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

@ -1,5 +1,5 @@
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"

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

@ -2,7 +2,9 @@
* 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/. */
var { MsgKeySet } = ChromeUtils.import("resource:///modules/MsgKeySet.jsm");
var { MsgKeySet } = ChromeUtils.importESModule(
"resource:///modules/MsgKeySet.sys.mjs"
);
/**
* Test MsgKeySet.addRange works correctly.

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

@ -8,8 +8,8 @@
* mail.accountmanager.accounts list, and removing duplicate accounts with
* the same server.
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
function run_test() {

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

@ -5,8 +5,8 @@
/**
* This tests various methods and attributes on nsIMsgAccountManager.
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
add_task(async function () {

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

@ -2,8 +2,8 @@
* 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/. */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
function run_test() {

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

@ -6,8 +6,8 @@
* This tests that if the default account is removed, the default becomes
* another account or null. The removed account must not remain the default.
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
function run_test() {

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

@ -7,8 +7,8 @@
* without having an account that points at it.
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
function run_test() {

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

@ -6,8 +6,8 @@
* Testing of bcc in message summary file added in bug 481667
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
var { MailServices } = ChromeUtils.importESModule(
"resource:///modules/MailServices.sys.mjs"
);
var hdr;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше