Bug 1620556 - comm-central automatic code fixes for Prettier 1.19.1 upgrade. rs=eslint

--HG--
extra : amend_source : a3a3a71e4de9500d0466ca28f7804bc3ad500426
This commit is contained in:
Magnus Melin 2020-03-14 14:33:11 +02:00
Родитель bd5464e182
Коммит 771b361ca1
32 изменённых файлов: 840 добавлений и 140 удалений

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

@ -74,7 +74,10 @@ CalEvent.prototype = {
return this.startDate;
},
icsEventPropMap: [{ cal: "DTSTART", ics: "startTime" }, { cal: "DTEND", ics: "endTime" }],
icsEventPropMap: [
{ cal: "DTSTART", ics: "startTime" },
{ cal: "DTEND", ics: "endTime" },
],
set icalString(value) {
this.icalComponent = cal.getIcsService().parseICS(value, null);

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

@ -174,7 +174,10 @@ var TopComponent = React.createClass({
initialAttachments: {},
tabs: ["Description", "More", "Reminders", "Attachments", "Attendees"],
calendarList: [[0, "Home"], [1, "Work"]],
calendarList: [
[0, "Home"],
[1, "Work"],
],
privacyList: [
["NONE", "Not Specified"],
["PUBLIC", "Public Event"],
@ -194,7 +197,10 @@ var TopComponent = React.createClass({
[5, "Normal"],
[1, "High"],
],
showTimeAsList: [["OPAQUE", true], ["TRANSPARENT", false]],
showTimeAsList: [
["OPAQUE", true],
["TRANSPARENT", false],
],
repeatList: [
["none", "Does Not Repeat"],
["daily", "Daily"],

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

@ -4230,11 +4230,9 @@ function displayCounterProposal() {
if (idCounter > 0) {
if (partStat && attendeeId.length) {
document.getElementById("counter-proposal-summary").value = cal.l10n.getString(
"calendar-event-dialog",
partStat,
[attendeeId]
);
document.getElementById(
"counter-proposal-summary"
).value = cal.l10n.getString("calendar-event-dialog", partStat, [attendeeId]);
document.getElementById("counter-proposal-summary").removeAttribute("collapsed");
}
if (comment) {

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

@ -51,7 +51,10 @@ add_task(async () => {
// Although the order of expectedTasks matches the observed behaviour when
// this test was written, order is NOT checked here. The order of the list
// is not well defined (particularly when changing the filter text).
ok(expectedTasks.every(task => actualTasks.includes(task)), "All expected tasks found");
ok(
expectedTasks.every(task => actualTasks.includes(task)),
"All expected tasks found"
);
}
let today = cal.dtz.now();

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

@ -55,7 +55,16 @@ add_task(async function testTimezones2_CreateEvents() {
goToDate(controller, 2009, 1, 1);
// Create weekly recurring events in all TIMEZONES.
let times = [[4, 30], [5, 0], [3, 0], [3, 0], [9, 0], [14, 0], [19, 45], [1, 30]];
let times = [
[4, 30],
[5, 0],
[3, 0],
[3, 0],
[9, 0],
[14, 0],
[19, 45],
[1, 30],
];
let time = new Date();
for (let i = 0; i < TIMEZONES.length; i++) {
let eventBox = lookupEventBox("day", CANVAS_BOX, null, 1, i + 11);
@ -82,14 +91,86 @@ add_task(async function testTimezones2_CreateEvents() {
add_task(function testTimezones3_checkStJohns() {
Services.prefs.setStringPref("calendar.timezone.local", "America/St_Johns");
let times = [
[[4, 30], [5, 30], [6, 30], [7, 30], [8, 30], [9, 30], [10, 30], [11, 30]],
[[4, 30], [6, 30], [7, 30], [7, 30], [9, 30], [9, 30], [11, 30], [12, 30]],
[[4, 30], [6, 30], [7, 30], [7, 30], [9, 30], [9, 30], [11, 30], [13, 30]],
[[4, 30], [6, 30], [7, 30], [7, 30], [9, 30], [9, 30], [11, 30], [13, 30]],
[[4, 30], [6, 30], [7, 30], [7, 30], [9, 30], [9, 30], [11, 30], [13, 30]],
[[4, 30], [6, 30], [7, 30], [7, 30], [9, 30], [9, 30], [11, 30], [12, 30]],
[[4, 30], [6, 30], [7, 30], [7, 30], [9, 30], [10, 30], [11, 30], [12, 30]],
[[4, 30], [5, 30], [6, 30], [7, 30], [8, 30], [9, 30], [10, 30], [11, 30]],
[
[4, 30],
[5, 30],
[6, 30],
[7, 30],
[8, 30],
[9, 30],
[10, 30],
[11, 30],
],
[
[4, 30],
[6, 30],
[7, 30],
[7, 30],
[9, 30],
[9, 30],
[11, 30],
[12, 30],
],
[
[4, 30],
[6, 30],
[7, 30],
[7, 30],
[9, 30],
[9, 30],
[11, 30],
[13, 30],
],
[
[4, 30],
[6, 30],
[7, 30],
[7, 30],
[9, 30],
[9, 30],
[11, 30],
[13, 30],
],
[
[4, 30],
[6, 30],
[7, 30],
[7, 30],
[9, 30],
[9, 30],
[11, 30],
[13, 30],
],
[
[4, 30],
[6, 30],
[7, 30],
[7, 30],
[9, 30],
[9, 30],
[11, 30],
[12, 30],
],
[
[4, 30],
[6, 30],
[7, 30],
[7, 30],
[9, 30],
[10, 30],
[11, 30],
[12, 30],
],
[
[4, 30],
[5, 30],
[6, 30],
[7, 30],
[8, 30],
[9, 30],
[10, 30],
[11, 30],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -103,14 +184,86 @@ add_task(function testTimezones4_checkCaracas() {
// This is actually incorrect. Venezuela shifted clocks forward 30 minutes
// in 2016, but our code doesn't handle historical timezones.
let times = [
[[4, 0], [5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0]],
[[3, 0], [5, 0], [6, 0], [6, 0], [8, 0], [8, 0], [10, 0], [11, 0]],
[[3, 0], [5, 0], [6, 0], [6, 0], [8, 0], [8, 0], [10, 0], [12, 0]],
[[3, 0], [5, 0], [6, 0], [6, 0], [8, 0], [8, 0], [10, 0], [12, 0]],
[[3, 0], [5, 0], [6, 0], [6, 0], [8, 0], [8, 0], [10, 0], [12, 0]],
[[3, 0], [5, 0], [6, 0], [6, 0], [8, 0], [8, 0], [10, 0], [11, 0]],
[[3, 0], [5, 0], [6, 0], [6, 0], [8, 0], [9, 0], [10, 0], [11, 0]],
[[4, 0], [5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0]],
[
[4, 0],
[5, 0],
[6, 0],
[7, 0],
[8, 0],
[9, 0],
[10, 0],
[11, 0],
],
[
[3, 0],
[5, 0],
[6, 0],
[6, 0],
[8, 0],
[8, 0],
[10, 0],
[11, 0],
],
[
[3, 0],
[5, 0],
[6, 0],
[6, 0],
[8, 0],
[8, 0],
[10, 0],
[12, 0],
],
[
[3, 0],
[5, 0],
[6, 0],
[6, 0],
[8, 0],
[8, 0],
[10, 0],
[12, 0],
],
[
[3, 0],
[5, 0],
[6, 0],
[6, 0],
[8, 0],
[8, 0],
[10, 0],
[12, 0],
],
[
[3, 0],
[5, 0],
[6, 0],
[6, 0],
[8, 0],
[8, 0],
[10, 0],
[11, 0],
],
[
[3, 0],
[5, 0],
[6, 0],
[6, 0],
[8, 0],
[9, 0],
[10, 0],
[11, 0],
],
[
[4, 0],
[5, 0],
[6, 0],
[7, 0],
[8, 0],
[9, 0],
[10, 0],
[11, 0],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -122,14 +275,86 @@ add_task(function testTimezones4_checkCaracas() {
add_task(function testTimezones5_checkPhoenix() {
Services.prefs.setStringPref("calendar.timezone.local", "America/Phoenix");
let times = [
[[1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [8, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [9, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [9, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [9, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [8, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [6, 0], [7, 0], [8, 0]],
[[1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0]],
[
[1, 0],
[2, 0],
[3, 0],
[4, 0],
[5, 0],
[6, 0],
[7, 0],
[8, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[8, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[9, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[9, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[9, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[8, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[6, 0],
[7, 0],
[8, 0],
],
[
[1, 0],
[2, 0],
[3, 0],
[4, 0],
[5, 0],
[6, 0],
[7, 0],
[8, 0],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -141,14 +366,86 @@ add_task(function testTimezones5_checkPhoenix() {
add_task(function testTimezones6_checkLosAngeles() {
Services.prefs.setStringPref("calendar.timezone.local", "America/Los_Angeles");
let times = [
[[0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [8, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [9, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [9, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [9, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [5, 0], [7, 0], [8, 0]],
[[0, 0], [2, 0], [3, 0], [3, 0], [5, 0], [6, 0], [7, 0], [8, 0]],
[[0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0]],
[
[0, 0],
[1, 0],
[2, 0],
[3, 0],
[4, 0],
[5, 0],
[6, 0],
[7, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[8, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[9, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[9, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[9, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[5, 0],
[7, 0],
[8, 0],
],
[
[0, 0],
[2, 0],
[3, 0],
[3, 0],
[5, 0],
[6, 0],
[7, 0],
[8, 0],
],
[
[0, 0],
[1, 0],
[2, 0],
[3, 0],
[4, 0],
[5, 0],
[6, 0],
[7, 0],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -160,14 +457,86 @@ add_task(function testTimezones6_checkLosAngeles() {
add_task(function testTimezones7_checkBuenosAires() {
Services.prefs.setStringPref("calendar.timezone.local", "America/Argentina/Buenos_Aires");
let times = [
[[5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0], [12, 0]],
[[4, 0], [6, 0], [7, 0], [7, 0], [9, 0], [9, 0], [11, 0], [12, 0]],
[[4, 0], [6, 0], [7, 0], [7, 0], [9, 0], [9, 0], [11, 0], [13, 0]],
[[4, 0], [6, 0], [7, 0], [7, 0], [9, 0], [9, 0], [11, 0], [13, 0]],
[[4, 0], [6, 0], [7, 0], [7, 0], [9, 0], [9, 0], [11, 0], [13, 0]],
[[4, 0], [6, 0], [7, 0], [7, 0], [9, 0], [9, 0], [11, 0], [12, 0]],
[[4, 0], [6, 0], [7, 0], [7, 0], [9, 0], [10, 0], [11, 0], [12, 0]],
[[5, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0], [12, 0]],
[
[5, 0],
[6, 0],
[7, 0],
[8, 0],
[9, 0],
[10, 0],
[11, 0],
[12, 0],
],
[
[4, 0],
[6, 0],
[7, 0],
[7, 0],
[9, 0],
[9, 0],
[11, 0],
[12, 0],
],
[
[4, 0],
[6, 0],
[7, 0],
[7, 0],
[9, 0],
[9, 0],
[11, 0],
[13, 0],
],
[
[4, 0],
[6, 0],
[7, 0],
[7, 0],
[9, 0],
[9, 0],
[11, 0],
[13, 0],
],
[
[4, 0],
[6, 0],
[7, 0],
[7, 0],
[9, 0],
[9, 0],
[11, 0],
[13, 0],
],
[
[4, 0],
[6, 0],
[7, 0],
[7, 0],
[9, 0],
[9, 0],
[11, 0],
[12, 0],
],
[
[4, 0],
[6, 0],
[7, 0],
[7, 0],
[9, 0],
[10, 0],
[11, 0],
[12, 0],
],
[
[5, 0],
[6, 0],
[7, 0],
[8, 0],
[9, 0],
[10, 0],
[11, 0],
[12, 0],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -179,14 +548,86 @@ add_task(function testTimezones7_checkBuenosAires() {
add_task(function testTimezones8_checkParis() {
Services.prefs.setStringPref("calendar.timezone.local", "Europe/Paris");
let times = [
[[9, 0], [10, 0], [11, 0], [12, 0], [13, 0], [14, 0], [15, 0], [16, 0]],
[[9, 0], [11, 0], [12, 0], [12, 0], [14, 0], [14, 0], [16, 0], [17, 0]],
[[9, 0], [11, 0], [12, 0], [12, 0], [14, 0], [14, 0], [16, 0], [18, 0]],
[[9, 0], [11, 0], [12, 0], [12, 0], [14, 0], [14, 0], [16, 0], [18, 0]],
[[9, 0], [11, 0], [12, 0], [12, 0], [14, 0], [14, 0], [16, 0], [18, 0]],
[[9, 0], [11, 0], [12, 0], [12, 0], [14, 0], [14, 0], [16, 0], [17, 0]],
[[8, 0], [10, 0], [11, 0], [11, 0], [13, 0], [14, 0], [15, 0], [16, 0]],
[[9, 0], [10, 0], [11, 0], [12, 0], [13, 0], [14, 0], [15, 0], [16, 0]],
[
[9, 0],
[10, 0],
[11, 0],
[12, 0],
[13, 0],
[14, 0],
[15, 0],
[16, 0],
],
[
[9, 0],
[11, 0],
[12, 0],
[12, 0],
[14, 0],
[14, 0],
[16, 0],
[17, 0],
],
[
[9, 0],
[11, 0],
[12, 0],
[12, 0],
[14, 0],
[14, 0],
[16, 0],
[18, 0],
],
[
[9, 0],
[11, 0],
[12, 0],
[12, 0],
[14, 0],
[14, 0],
[16, 0],
[18, 0],
],
[
[9, 0],
[11, 0],
[12, 0],
[12, 0],
[14, 0],
[14, 0],
[16, 0],
[18, 0],
],
[
[9, 0],
[11, 0],
[12, 0],
[12, 0],
[14, 0],
[14, 0],
[16, 0],
[17, 0],
],
[
[8, 0],
[10, 0],
[11, 0],
[11, 0],
[13, 0],
[14, 0],
[15, 0],
[16, 0],
],
[
[9, 0],
[10, 0],
[11, 0],
[12, 0],
[13, 0],
[14, 0],
[15, 0],
[16, 0],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -198,14 +639,86 @@ add_task(function testTimezones8_checkParis() {
add_task(function testTimezones9_checkKathmandu() {
Services.prefs.setStringPref("calendar.timezone.local", "Asia/Kathmandu");
let times = [
[[13, 45], [14, 45], [15, 45], [16, 45], [17, 45], [18, 45], [19, 45], [20, 45]],
[[12, 45], [14, 45], [15, 45], [15, 45], [17, 45], [17, 45], [19, 45], [20, 45]],
[[12, 45], [14, 45], [15, 45], [15, 45], [17, 45], [17, 45], [19, 45], [21, 45]],
[[12, 45], [14, 45], [15, 45], [15, 45], [17, 45], [17, 45], [19, 45], [21, 45]],
[[12, 45], [14, 45], [15, 45], [15, 45], [17, 45], [17, 45], [19, 45], [21, 45]],
[[12, 45], [14, 45], [15, 45], [15, 45], [17, 45], [17, 45], [19, 45], [20, 45]],
[[12, 45], [14, 45], [15, 45], [15, 45], [17, 45], [18, 45], [19, 45], [20, 45]],
[[13, 45], [14, 45], [15, 45], [16, 45], [17, 45], [18, 45], [19, 45], [20, 45]],
[
[13, 45],
[14, 45],
[15, 45],
[16, 45],
[17, 45],
[18, 45],
[19, 45],
[20, 45],
],
[
[12, 45],
[14, 45],
[15, 45],
[15, 45],
[17, 45],
[17, 45],
[19, 45],
[20, 45],
],
[
[12, 45],
[14, 45],
[15, 45],
[15, 45],
[17, 45],
[17, 45],
[19, 45],
[21, 45],
],
[
[12, 45],
[14, 45],
[15, 45],
[15, 45],
[17, 45],
[17, 45],
[19, 45],
[21, 45],
],
[
[12, 45],
[14, 45],
[15, 45],
[15, 45],
[17, 45],
[17, 45],
[19, 45],
[21, 45],
],
[
[12, 45],
[14, 45],
[15, 45],
[15, 45],
[17, 45],
[17, 45],
[19, 45],
[20, 45],
],
[
[12, 45],
[14, 45],
[15, 45],
[15, 45],
[17, 45],
[18, 45],
[19, 45],
[20, 45],
],
[
[13, 45],
[14, 45],
[15, 45],
[16, 45],
[17, 45],
[18, 45],
[19, 45],
[20, 45],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");
@ -217,14 +730,86 @@ add_task(function testTimezones9_checkKathmandu() {
add_task(function testTimezones10_checkAdelaide() {
Services.prefs.setStringPref("calendar.timezone.local", "Australia/Adelaide");
let times = [
[[18, 30], [19, 30], [20, 30], [21, 30], [22, 30], [23, 30], [0, 30, +1], [1, 30, +1]],
[[17, 30], [19, 30], [20, 30], [20, 30], [22, 30], [22, 30], [0, 30, +1], [1, 30, +1]],
[[16, 30], [18, 30], [19, 30], [19, 30], [21, 30], [21, 30], [23, 30], [1, 30, +1]],
[[16, 30], [18, 30], [19, 30], [19, 30], [21, 30], [21, 30], [23, 30], [1, 30, +1]],
[[16, 30], [18, 30], [19, 30], [19, 30], [21, 30], [21, 30], [23, 30], [1, 30, +1]],
[[17, 30], [19, 30], [20, 30], [20, 30], [22, 30], [22, 30], [0, 30, +1], [1, 30, +1]],
[[17, 30], [19, 30], [20, 30], [20, 30], [22, 30], [23, 30], [0, 30, +1], [1, 30, +1]],
[[18, 30], [19, 30], [20, 30], [21, 30], [22, 30], [23, 30], [0, 30, +1], [1, 30, +1]],
[
[18, 30],
[19, 30],
[20, 30],
[21, 30],
[22, 30],
[23, 30],
[0, 30, +1],
[1, 30, +1],
],
[
[17, 30],
[19, 30],
[20, 30],
[20, 30],
[22, 30],
[22, 30],
[0, 30, +1],
[1, 30, +1],
],
[
[16, 30],
[18, 30],
[19, 30],
[19, 30],
[21, 30],
[21, 30],
[23, 30],
[1, 30, +1],
],
[
[16, 30],
[18, 30],
[19, 30],
[19, 30],
[21, 30],
[21, 30],
[23, 30],
[1, 30, +1],
],
[
[16, 30],
[18, 30],
[19, 30],
[19, 30],
[21, 30],
[21, 30],
[23, 30],
[1, 30, +1],
],
[
[17, 30],
[19, 30],
[20, 30],
[20, 30],
[22, 30],
[22, 30],
[0, 30, +1],
[1, 30, +1],
],
[
[17, 30],
[19, 30],
[20, 30],
[20, 30],
[22, 30],
[23, 30],
[0, 30, +1],
[1, 30, +1],
],
[
[18, 30],
[19, 30],
[20, 30],
[21, 30],
[22, 30],
[23, 30],
[0, 30, +1],
[1, 30, +1],
],
];
controller.click(eid("calendar-tab-button"));
switchToView(controller, "day");

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

@ -127,7 +127,10 @@ add_task(async function testDailyRecurrence() {
// Check day view for 7 days.
let day = lookupEventBox("day", EVENT_BOX, null, 1, null, EVENTPATH);
let dates = [[2009, 1, 3], [2009, 1, 4]];
let dates = [
[2009, 1, 3],
[2009, 1, 4],
];
for (let [y, m, d] of dates) {
goToDate(controller, y, m, d);
controller.assertNodeNotExist(day);

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

@ -135,7 +135,10 @@ add_task(async function testDailyRecurrence() {
// Check day view for 7 days.
let day = lookupEventBox("day", EVENT_BOX, null, 1, null, EVENTPATH);
let dates = [[2009, 1, 3], [2009, 1, 4]];
let dates = [
[2009, 1, 3],
[2009, 1, 4],
];
for (let [y, m, d] of dates) {
goToDate(controller, y, m, d);
controller.assertNodeNotExist(day);

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

@ -546,8 +546,14 @@ function test_getAttendeesBySender() {
cal.itip.getAttendeesBySender(attendees, test.input.sender).forEach(att => {
detected.push(att.id);
});
ok(detected.every(aId => test.expected.includes(aId)), "(test #" + i + " ok1)");
ok(test.expected.every(aId => detected.includes(aId)), "(test #" + i + " ok2)");
ok(
detected.every(aId => test.expected.includes(aId)),
"(test #" + i + " ok1)"
);
ok(
test.expected.every(aId => detected.includes(aId)),
"(test #" + i + " ok2)"
);
}
}

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

@ -69,10 +69,16 @@ function test_sort_items() {
});
cal.unifinder.sortItems(items, "title", 1);
deepEqual(items.map(item => item.title), ["a", "b", null]);
deepEqual(
items.map(item => item.title),
["a", "b", null]
);
cal.unifinder.sortItems(items, "title", -1);
deepEqual(items.map(item => item.title), [null, "b", "a"]);
deepEqual(
items.map(item => item.title),
[null, "b", "a"]
);
// date comparison
let dates = ["20180101T000002Z", "20180101T000000Z", "20180101T000001Z"];
@ -85,18 +91,16 @@ function test_sort_items() {
});
cal.unifinder.sortItems(items, "startDate", 1);
deepEqual(items.map(item => item.startDate.icalString), [
"20180101T000000Z",
"20180101T000001Z",
"20180101T000002Z",
]);
deepEqual(
items.map(item => item.startDate.icalString),
["20180101T000000Z", "20180101T000001Z", "20180101T000002Z"]
);
cal.unifinder.sortItems(items, "startDate", -1);
deepEqual(items.map(item => item.startDate.icalString), [
"20180101T000002Z",
"20180101T000001Z",
"20180101T000000Z",
]);
deepEqual(
items.map(item => item.startDate.icalString),
["20180101T000002Z", "20180101T000001Z", "20180101T000000Z"]
);
// number comparison
let percents = [3, 1, 2];
@ -109,8 +113,14 @@ function test_sort_items() {
});
cal.unifinder.sortItems(items, "percentComplete", 1);
deepEqual(items.map(item => item.percentComplete), [1, 2, 3]);
deepEqual(
items.map(item => item.percentComplete),
[1, 2, 3]
);
cal.unifinder.sortItems(items, "percentComplete", -1);
deepEqual(items.map(item => item.percentComplete), [3, 2, 1]);
deepEqual(
items.map(item => item.percentComplete),
[3, 2, 1]
);
}

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

@ -195,7 +195,10 @@ var test_queueFileOperation = async function() {
let p2 = qFO("path2", dummyRejectedOperation);
equal(gFP.get("path2"), p2);
// This should throw since p2 rejected. Drop the error.
await p2.then(() => do_throw(), () => {});
await p2.then(
() => do_throw(),
() => {}
);
ok(!gFP.has("path2"));
let onPromiseComplete = (aPromise, aHandler) => {

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

@ -27,7 +27,10 @@ function test_setter_getter() {
}
function test_constructor() {
let k = new NormalizedMap(aStr => aStr.toLowerCase(), [["A", 2], ["b", 3]]);
let k = new NormalizedMap(aStr => aStr.toLowerCase(), [
["A", 2],
["b", 3],
]);
Assert.equal(k.get("b"), 3);
Assert.equal(k.get("a"), 2);
Assert.equal(k.get("B"), 3);

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

@ -308,7 +308,11 @@ function testTags() {
origin: "quux",
user: undefined,
host: undefined,
tags: new Map([["c", undefined], ["h", ""], ["a", "b"]]),
tags: new Map([
["c", undefined],
["h", ""],
["a", "b"],
]),
source: "",
},
"@time=2012-06-30T23:59:60.419Z :John!~john@1.2.3.4 JOIN #chan": {

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

@ -797,7 +797,10 @@ Account.prototype = {
this.signAndSend(url, null, [], aOnSent, aOnError, aThis);
},
directMessage(aMsg, aName, aOnSent, aOnError, aThis) {
let POSTData = [["text", aMsg], ["screen_name", aName]];
let POSTData = [
["text", aMsg],
["screen_name", aName],
];
this.signAndSend(
"1.1/direct_messages/new.json",
null,

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

@ -66,8 +66,8 @@ function XMPPSession(aHost, aPort, aSecurity, aJID, aPassword, aAccount) {
// RFC 6120 (Section 3.2.3): When Not to Use SRV.
if (
Services.prefs.getBoolPref("chat.dns.srv.disable") ||
(this._account.prefs.prefHasUserValue("server") ||
this._account.prefs.prefHasUserValue("port"))
this._account.prefs.prefHasUserValue("server") ||
this._account.prefs.prefHasUserValue("port")
) {
this.connect(this._host, this._port, this._security);
return;

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

@ -75,7 +75,7 @@ var editContactInlineUI = {
}
// Only handle the read-only cases here.
if (aHandleOnlyReadOnly && (this._writeable && !aEvent.target.readOnly)) {
if (aHandleOnlyReadOnly && this._writeable && !aEvent.target.readOnly) {
return;
}

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

@ -839,7 +839,7 @@
// doesn't keep the window alive.
browser.permanentKey = new (Cu.getGlobalForObject(
Services
)).Object();
).Object)();
}
return browser;
},

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

@ -1402,8 +1402,8 @@ DBViewWrapper.prototype = {
if (this.isVirtual) {
if (
this.isMultiFolder &&
(changedFlags & Ci.nsMsgViewFlagsType.kThreadedDisplay &&
!(changedFlags & Ci.nsMsgViewFlagsType.kGroupBySort))
changedFlags & Ci.nsMsgViewFlagsType.kThreadedDisplay &&
!(changedFlags & Ci.nsMsgViewFlagsType.kGroupBySort)
) {
reSort = true;
}

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

@ -625,11 +625,13 @@ var snapshotFormatters = {
apzInfo.length
? [
new Text(
(await document.l10n.formatValues(
apzInfo.map(id => {
return { id };
})
)).join("; ")
(
await document.l10n.formatValues(
apzInfo.map(id => {
return { id };
})
)
).join("; ")
),
]
: "apz-none"

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

@ -487,7 +487,10 @@ function PriorityOrderAbortable(successCallback, errorCallback) {
}
if (!this._successfulCall) {
// all failed
errorCallback(this._calls[0].e, this._calls.map(call => call.e)); // see docs above
errorCallback(
this._calls[0].e,
this._calls.map(call => call.e)
); // see docs above
}
});
}

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

@ -225,8 +225,8 @@ class TabsUpdateFilterEventManager extends EventManager {
if (
filter &&
filter.urls &&
(!extension.hasPermission("tabs") &&
!extension.hasPermission("activeTab"))
!extension.hasPermission("tabs") &&
!extension.hasPermission("activeTab")
) {
Cu.reportError(
'Url filtering in tabs.onUpdated requires "tabs" or "activeTab" permission.'

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

@ -1161,9 +1161,9 @@
if (
event.charCode == 0 && // it's not a character, it's a command key
(event.keyCode != 13 && // Return
event.keyCode != 13 && // Return
event.keyCode != 8 && // Backspace
event.keyCode != 46)
event.keyCode != 46
) {
// Delete
return;

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

@ -521,9 +521,9 @@ var GlodaIMIndexer = {
: logFiles;
for (let logFile of currentLogFiles) {
let fileName = OS.Path.basename(logFile);
let lastModifiedTime = (await OS.File.stat(
logFile
)).lastModificationDate.valueOf();
let lastModifiedTime = (
await OS.File.stat(logFile)
).lastModificationDate.valueOf();
if (
Object.prototype.hasOwnProperty.call(conv.convObj, fileName) &&
conv.convObj[fileName] == lastModifiedTime

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

@ -255,7 +255,10 @@ function test_getIncomingTryOrder() {
ssl = SSL;
tryOrder = getIncomingTryOrder(domain, protocol, ssl, port);
assert_equal_try_orders(tryOrder, [[IMAP, SSL, 993], [POP, SSL, 995]]);
assert_equal_try_orders(tryOrder, [
[IMAP, SSL, 993],
[POP, SSL, 995],
]);
ssl = UNKNOWN;
port = 31337;
@ -271,7 +274,10 @@ function test_getIncomingTryOrder() {
ssl = SSL;
tryOrder = getIncomingTryOrder(domain, protocol, ssl, port);
assert_equal_try_orders(tryOrder, [[IMAP, SSL, port], [POP, SSL, port]]);
assert_equal_try_orders(tryOrder, [
[IMAP, SSL, port],
[POP, SSL, port],
]);
}
/**

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

@ -62,13 +62,19 @@ add_task(async function test_recording_state() {
events.forEach(e => Telemetry.recordEvent(...e));
TelemetryTestUtils.assertEvents([]);
// But still expect a non-zero summary count.
checkEventSummary(events.map(e => ["parent", e, 1]), true);
checkEventSummary(
events.map(e => ["parent", e, 1]),
true
);
// Once again, with recording on.
Telemetry.setEventRecordingEnabled("tb.test", true);
events.forEach(e => Telemetry.recordEvent(...e));
TelemetryTestUtils.assertEvents(events);
checkEventSummary(events.map(e => ["parent", e, 1]), true);
checkEventSummary(
events.map(e => ["parent", e, 1]),
true
);
});
/**

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

@ -49,9 +49,12 @@ add_task(function setupModule(module) {
* @return the focused pane
*/
function get_focused_pane() {
let panes = ["threadTree", "folderTree", "messagepane", "multimessage"].map(
id => mc.e(id)
);
let panes = [
"threadTree",
"folderTree",
"messagepane",
"multimessage",
].map(id => mc.e(id));
let currentNode = mc.window.top.document.activeElement;

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

@ -69,10 +69,17 @@ add_task(function test_filter_starred() {
add_task(function test_filter_simple_intersection_unread_and_starred() {
let folder = create_folder("QuickFilterBarFilterUnreadAndStarred");
let [, readUnstarred, unreadStarred, readStarred] = make_new_sets_in_folder(
folder,
[{ count: 1 }, { count: 1 }, { count: 1 }, { count: 1 }]
);
let [
,
readUnstarred,
unreadStarred,
readStarred,
] = make_new_sets_in_folder(folder, [
{ count: 1 },
{ count: 1 },
{ count: 1 },
{ count: 1 },
]);
readUnstarred.setRead(true);
unreadStarred.setStarred(true);
readStarred.setRead(true);
@ -153,10 +160,19 @@ add_task(function test_filter_tags() {
const tagA = "$label1",
tagB = "$label2",
tagC = "$label3";
let [setNoTag, setTagA, setTagB, setTagAB, setTagC] = make_new_sets_in_folder(
folder,
[{ count: 1 }, { count: 1 }, { count: 1 }, { count: 1 }, { count: 1 }]
);
let [
setNoTag,
setTagA,
setTagB,
setTagAB,
setTagC,
] = make_new_sets_in_folder(folder, [
{ count: 1 },
{ count: 1 },
{ count: 1 },
{ count: 1 },
{ count: 1 },
]);
setTagA.addTag(tagA);
setTagB.addTag(tagB);
setTagAB.addTag(tagA);

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

@ -54,7 +54,10 @@ var intlPhrases = [
encodings: {
"utf-8": ["=?utf-8?q?aa_bbb?=", "aa bbb"],
},
searchPhrases: [{ body: "aa", match: false }, { body: "bbb", match: true }],
searchPhrases: [
{ body: "aa", match: false },
{ body: "bbb", match: true },
],
},
];

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

@ -83,7 +83,12 @@ var tests = [
// spam1 trained as "pro" for first pro/anti pair
// spam4 trained as "anti" for second pro/anti pair
// others are partials
percents: [[100, 50], [81, 0], [98, 50], [81, 0]],
percents: [
[100, 50],
[81, 0],
[98, 50],
[81, 0],
],
},
// reset the plugin, read in data, and retest the classification
// this tests the trait file writing
@ -109,7 +114,12 @@ var tests = [
fileName: "spam1.eml,spam2.eml,spam3.eml,spam4.eml",
traitIds: [4, 6],
traitAntiIds: [3, 5],
percents: [[100, 50], [81, 0], [98, 50], [81, 0]],
percents: [
[100, 50],
[81, 0],
[98, 50],
[81, 0],
],
},
];

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

@ -454,7 +454,10 @@ define(function(require) {
],
[
'" "@a a;b',
[{ name: "", email: '" "@a a' }, { name: "b", email: "" }],
[
{ name: "", email: '" "@a a' },
{ name: "b", email: "" },
],
],
[
"Undisclosed recipients:;\0:; foo <ghj@veryveryveryverylongveryveryver" +
@ -472,7 +475,10 @@ define(function(require) {
// XXX: test_nsIMsgHeaderParser2 has an empty one here...
[
"<a;a@invalid",
[{ name: "", email: "a" }, { name: "", email: "a@invalid" }],
[
{ name: "", email: "a" },
{ name: "", email: "a@invalid" },
],
],
["me@foo.invalid", [{ name: "", email: "me@foo.invalid" }]],
[

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

@ -41,11 +41,17 @@ define(function(require) {
"John Doe <a@example.com>",
],
[
[{ name: "", email: "a@b.c" }, { name: "", email: "b@b.c" }],
[
{ name: "", email: "a@b.c" },
{ name: "", email: "b@b.c" },
],
"a@b.c, b@b.c",
],
[
[{ name: "JD", email: "a@a.c" }, { name: "SD", email: "b@b.c" }],
[
{ name: "JD", email: "a@a.c" },
{ name: "SD", email: "b@b.c" },
],
"JD <a@a.c>, SD <b@b.c>",
],
[

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

@ -16,7 +16,10 @@ function run_test() {
},
{
displayString: "test@foo.invalid, test2@foo.invalid",
addresses: [["", "test@foo.invalid"], ["", "test2@foo.invalid"]],
addresses: [
["", "test@foo.invalid"],
["", "test2@foo.invalid"],
],
},
{
displayString: "John Doe <test@foo.invalid>",

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

@ -80,8 +80,14 @@ function run_test() {
[
// This used to cause memory read overruns.
'" "@a a;b',
[{ name: "", email: '" "@a a' }, { name: "b", email: "" }],
[{ name: "", email: "@a a" }, { name: "b", email: "" }],
[
{ name: "", email: '" "@a a' },
{ name: "b", email: "" },
],
[
{ name: "", email: "@a a" },
{ name: "b", email: "" },
],
],
];