Bug 1151475 - Part 1: Remove use of expression closure from mail/base/. r=mkmelin
This commit is contained in:
Родитель
63b17cce61
Коммит
b12d0e2b39
|
@ -1134,7 +1134,7 @@ let gFolderTreeView = {
|
||||||
let folderItem = new ftvItem(subFolders[0]);
|
let folderItem = new ftvItem(subFolders[0]);
|
||||||
folderItem._level = 0;
|
folderItem._level = 0;
|
||||||
if (flag & nsMsgFolderFlags.Inbox)
|
if (flag & nsMsgFolderFlags.Inbox)
|
||||||
folderItem.__defineGetter__("children", function() []);
|
folderItem.__defineGetter__("children", () => []);
|
||||||
if (position == undefined)
|
if (position == undefined)
|
||||||
map.push(folderItem);
|
map.push(folderItem);
|
||||||
else
|
else
|
||||||
|
@ -1183,7 +1183,7 @@ let gFolderTreeView = {
|
||||||
// don't show sub-folders of the inbox, but I think Archives/Sent, etc
|
// don't show sub-folders of the inbox, but I think Archives/Sent, etc
|
||||||
// should have the sub-folders.
|
// should have the sub-folders.
|
||||||
if (flag & nsMsgFolderFlags.Inbox)
|
if (flag & nsMsgFolderFlags.Inbox)
|
||||||
child.__defineGetter__("children", function() []);
|
child.__defineGetter__("children", () => []);
|
||||||
// If we have consecutive children with the same server, then both
|
// If we have consecutive children with the same server, then both
|
||||||
// should display as folder - server.
|
// should display as folder - server.
|
||||||
if (prevChild && (child._folder.server == prevChild._folder.server)) {
|
if (prevChild && (child._folder.server == prevChild._folder.server)) {
|
||||||
|
@ -1507,7 +1507,7 @@ let gFolderTreeView = {
|
||||||
|
|
||||||
// There are no children in this view!
|
// There are no children in this view!
|
||||||
for (let folder of map) {
|
for (let folder of map) {
|
||||||
folder.__defineGetter__("children", function() []);
|
folder.__defineGetter__("children", () => []);
|
||||||
folder.addServerName = true;
|
folder.addServerName = true;
|
||||||
}
|
}
|
||||||
sortFolderItems(map);
|
sortFolderItems(map);
|
||||||
|
@ -1602,7 +1602,7 @@ let gFolderTreeView = {
|
||||||
// There are no children in this view!
|
// There are no children in this view!
|
||||||
for (let item of faves) {
|
for (let item of faves) {
|
||||||
let name = item._folder.abbreviatedName.toLocaleLowerCase();
|
let name = item._folder.abbreviatedName.toLocaleLowerCase();
|
||||||
item.__defineGetter__("children", function() []);
|
item.__defineGetter__("children", () => []);
|
||||||
item.addServerName = dupeNames.has(name);
|
item.addServerName = dupeNames.has(name);
|
||||||
}
|
}
|
||||||
sortFolderItems(faves);
|
sortFolderItems(faves);
|
||||||
|
@ -1655,7 +1655,7 @@ let gFolderTreeView = {
|
||||||
// And we want to display the account name to distinguish folders w/
|
// And we want to display the account name to distinguish folders w/
|
||||||
// the same name.
|
// the same name.
|
||||||
for (let folder of items) {
|
for (let folder of items) {
|
||||||
folder.__defineGetter__("children", function() []);
|
folder.__defineGetter__("children", () => []);
|
||||||
folder.addServerName = true;
|
folder.addServerName = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1755,7 +1755,7 @@ let gFolderTreeView = {
|
||||||
get _allSmartFlags() {
|
get _allSmartFlags() {
|
||||||
delete this._allSmartFlags;
|
delete this._allSmartFlags;
|
||||||
return this._allSmartFlags = this._flagNameList.reduce(
|
return this._allSmartFlags = this._flagNameList.reduce(
|
||||||
function (res, [flag,, isDeep,]) res | flag, 0);
|
(res, [flag,, isDeep,]) => res | flag, 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1764,7 +1764,7 @@ let gFolderTreeView = {
|
||||||
get _allShallowFlags() {
|
get _allShallowFlags() {
|
||||||
delete this._allShallowFlags;
|
delete this._allShallowFlags;
|
||||||
return this._allShallowFlags = this._flagNameList.reduce(
|
return this._allShallowFlags = this._flagNameList.reduce(
|
||||||
function (res, [flag,, isDeep,]) isDeep ? res : (res | flag), 0);
|
(res, [flag,, isDeep,]) => isDeep ? res : (res | flag), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2023,7 +2023,7 @@ let gFolderTreeView = {
|
||||||
newChild.useServerNameOnly = true;
|
newChild.useServerNameOnly = true;
|
||||||
}
|
}
|
||||||
if (aItem.flags & nsMsgFolderFlags.Inbox)
|
if (aItem.flags & nsMsgFolderFlags.Inbox)
|
||||||
newChild.__defineGetter__("children", function() []);
|
newChild.__defineGetter__("children", () => []);
|
||||||
if (parent)
|
if (parent)
|
||||||
this._addChildToView(parent, parentIndex, newChild);
|
this._addChildToView(parent, parentIndex, newChild);
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -1655,7 +1655,7 @@
|
||||||
// Sort the matches by index, just to be sure.
|
// Sort the matches by index, just to be sure.
|
||||||
// They are probably already sorted, but if they aren't it could
|
// They are probably already sorted, but if they aren't it could
|
||||||
// mess things up at the next step.
|
// mess things up at the next step.
|
||||||
matches.sort(function(a, b) a[0] - b[0]);
|
matches.sort((a, b) => a[0] - b[0]);
|
||||||
|
|
||||||
// Convert the byte offsets and lengths into character indexes.
|
// Convert the byte offsets and lengths into character indexes.
|
||||||
let charCodeToByteCount = function(c) {
|
let charCodeToByteCount = function(c) {
|
||||||
|
|
|
@ -343,11 +343,11 @@ var FacetContext = {
|
||||||
else
|
else
|
||||||
scores = Gloda.scoreNounItems(items);
|
scores = Gloda.scoreNounItems(items);
|
||||||
let scoredItems = items.map(function(item, index) { return [scores[index], item]; });
|
let scoredItems = items.map(function(item, index) { return [scores[index], item]; });
|
||||||
scoredItems.sort(function(a,b) b[0]-a[0]);
|
scoredItems.sort((a, b) => b[0]-a[0]);
|
||||||
this._relevantSortedItems = scoredItems.map(scoredItem => scoredItem[1]);
|
this._relevantSortedItems = scoredItems.map(scoredItem => scoredItem[1]);
|
||||||
|
|
||||||
this._dateSortedItems =
|
this._dateSortedItems =
|
||||||
this._relevantSortedItems.concat().sort(function(a,b) b.date-a.date);
|
this._relevantSortedItems.concat().sort((a, b) => b.date-a.date);
|
||||||
},
|
},
|
||||||
|
|
||||||
initialBuild: function() {
|
initialBuild: function() {
|
||||||
|
|
|
@ -265,13 +265,13 @@ DateFacetVis.prototype = {
|
||||||
vis.add(pv.Bar)
|
vis.add(pv.Bar)
|
||||||
.data(bins)
|
.data(bins)
|
||||||
.bottom(0)
|
.bottom(0)
|
||||||
.height(function (d) Math.floor(d.items.length * binScale))
|
.height(d => Math.floor(d.items.length * binScale))
|
||||||
.width(function() barWidth)
|
.width(() => barWidth)
|
||||||
.left(function() isRTL ? null : (this.index * barPix))
|
.left(function() { return isRTL ? null : (this.index * barPix); })
|
||||||
.right(function() isRTL ? (this.index * barPix) : null)
|
.right(function() { return isRTL ? (this.index * barPix) : null; })
|
||||||
.fillStyle("#add2fb")
|
.fillStyle("#add2fb")
|
||||||
.event("mouseover", function(d) this.fillStyle("#3465a4"))
|
.event("mouseover", function(d) { return this.fillStyle("#3465a4"); })
|
||||||
.event("mouseout", function(d) this.fillStyle("#add2fb"))
|
.event("mouseout", function(d) { return this.fillStyle("#add2fb"); })
|
||||||
.event("click", function(d) {
|
.event("click", function(d) {
|
||||||
dis.constraints = [[d.startDate, d.endDate]];
|
dis.constraints = [[d.startDate, d.endDate]];
|
||||||
dis.binding.setAttribute("zoomedout", "false");
|
dis.binding.setAttribute("zoomedout", "false");
|
||||||
|
@ -283,9 +283,9 @@ DateFacetVis.prototype = {
|
||||||
this.hotBars = vis.add(pv.Bar)
|
this.hotBars = vis.add(pv.Bar)
|
||||||
.data(this.emptyBins)
|
.data(this.emptyBins)
|
||||||
.bottom(0)
|
.bottom(0)
|
||||||
.height(function (d) Math.floor(d * binScale))
|
.height(d => Math.floor(d * binScale))
|
||||||
.width(function() barWidth)
|
.width(() => barWidth)
|
||||||
.left(function() this.index * barPix)
|
.left(function() { return this.index * barPix; })
|
||||||
.fillStyle("#3465a4");
|
.fillStyle("#3465a4");
|
||||||
|
|
||||||
for (let labelTier of labelTiers) {
|
for (let labelTier of labelTiers) {
|
||||||
|
@ -293,13 +293,12 @@ DateFacetVis.prototype = {
|
||||||
.data(labelTier.displayValues)
|
.data(labelTier.displayValues)
|
||||||
.bottom(-totalAxisLabelHeight + labelTier.vertOffset)
|
.bottom(-totalAxisLabelHeight + labelTier.vertOffset)
|
||||||
.height(labelTier.vertHeight)
|
.height(labelTier.vertHeight)
|
||||||
.left(function(d) isRTL ? null : Math.floor(width * d[0]))
|
.left(d => isRTL ? null : Math.floor(width * d[0]))
|
||||||
.right(function(d) isRTL ? Math.floor(width * d[0]) : null)
|
.right(d => isRTL ? Math.floor(width * d[0]) : null)
|
||||||
.width(function(d)
|
.width(d => Math.floor(width * d[1]) - Math.floor(width * d[0]) - 1)
|
||||||
Math.floor(width * d[1]) - Math.floor(width * d[0]) - 1)
|
|
||||||
.fillStyle("#dddddd")
|
.fillStyle("#dddddd")
|
||||||
.event("mouseover", function(d) this.fillStyle("#3465a4"))
|
.event("mouseover", function(d) { return this.fillStyle("#3465a4"); })
|
||||||
.event("mouseout", function(d) this.fillStyle("#dddddd"))
|
.event("mouseout", function(d) { return this.fillStyle("#dddddd"); })
|
||||||
.event("click", function(d) {
|
.event("click", function(d) {
|
||||||
dis.constraints = [[d[3], d[4]]];
|
dis.constraints = [[d[3], d[4]]];
|
||||||
dis.binding.setAttribute("zoomedout", "false");
|
dis.binding.setAttribute("zoomedout", "false");
|
||||||
|
@ -313,7 +312,7 @@ DateFacetVis.prototype = {
|
||||||
.textAlign("center")
|
.textAlign("center")
|
||||||
.textBaseline("top")
|
.textBaseline("top")
|
||||||
.textStyle("black")
|
.textStyle("black")
|
||||||
.text(function(d) d[2]);
|
.text(d => d[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@
|
||||||
<constructor><![CDATA[
|
<constructor><![CDATA[
|
||||||
let children = Array.slice(this._childNodes);
|
let children = Array.slice(this._childNodes);
|
||||||
|
|
||||||
children.filter(function(aChild) aChild.getAttribute("selected") == "true")
|
children.filter(aChild => aChild.getAttribute("selected") == "true")
|
||||||
.forEach(this.selectedItems.push, this.selectedItems);
|
.forEach(this.selectedItems.push, this.selectedItems);
|
||||||
|
|
||||||
children.filter(function(aChild) !aChild.hasAttribute("context"))
|
children.filter(aChild => !aChild.hasAttribute("context"))
|
||||||
.forEach(function(aChild) aChild.setAttribute("context",
|
.forEach(aChild => aChild.setAttribute("context",
|
||||||
this.getAttribute("itemcontext")), this);
|
this.getAttribute("itemcontext")));
|
||||||
|
|
||||||
this.sizes = {small: 16, large: 32, tile: 32};
|
this.sizes = {small: 16, large: 32, tile: 32};
|
||||||
this.messenger = Components.classes["@mozilla.org/messenger;1"]
|
this.messenger = Components.classes["@mozilla.org/messenger;1"]
|
||||||
|
|
|
@ -1173,7 +1173,7 @@ function HideMessageHeaderPane()
|
||||||
function OutputNewsgroups(headerEntry, headerValue)
|
function OutputNewsgroups(headerEntry, headerValue)
|
||||||
{
|
{
|
||||||
headerValue.split(",").forEach(
|
headerValue.split(",").forEach(
|
||||||
function(newsgroup) headerEntry.enclosingBox.addNewsgroupView(newsgroup));
|
newsgroup => headerEntry.enclosingBox.addNewsgroupView(newsgroup));
|
||||||
|
|
||||||
headerEntry.enclosingBox.buildViews();
|
headerEntry.enclosingBox.buildViews();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1797,9 +1797,9 @@ let TabsInTitlebar = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_update: function (aForce=false) {
|
_update: function (aForce=false) {
|
||||||
function $(id) document.getElementById(id);
|
function $(id) { return document.getElementById(id); }
|
||||||
function rect(ele) ele.getBoundingClientRect();
|
function rect(ele) { return ele.getBoundingClientRect(); }
|
||||||
function verticalMargins(cstyle) parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
|
function verticalMargins(cstyle) { return parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop); }
|
||||||
|
|
||||||
if (!this._initialized || window.fullScreen)
|
if (!this._initialized || window.fullScreen)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -985,7 +985,7 @@ var specialTabs = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldSwitchTo: function ({ chromePage: x })
|
shouldSwitchTo: ({ chromePage: x }) =>
|
||||||
contentTabBaseType.shouldSwitchTo({ contentPage: x }),
|
contentTabBaseType.shouldSwitchTo({ contentPage: x }),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@ const Windows8WindowFrameColor = {
|
||||||
// Zero-pad the number just to make sure that it is 8 digits.
|
// Zero-pad the number just to make sure that it is 8 digits.
|
||||||
customizationColorHex = ("00000000" + customizationColorHex).substr(-8);
|
customizationColorHex = ("00000000" + customizationColorHex).substr(-8);
|
||||||
let customizationColorArray = customizationColorHex.match(/../g);
|
let customizationColorArray = customizationColorHex.match(/../g);
|
||||||
let [unused, fgR, fgG, fgB] = customizationColorArray.map(function(val) parseInt(val, 16));
|
let [unused, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
|
||||||
let colorizationColorBalance = Registry.readRegKey(HKCU, dwmKey,
|
let colorizationColorBalance = Registry.readRegKey(HKCU, dwmKey,
|
||||||
"ColorizationColorBalance") || 78;
|
"ColorizationColorBalance") || 78;
|
||||||
// Window frame base color when Color Intensity is at 0, see bug 1004576.
|
// Window frame base color when Color Intensity is at 0, see bug 1004576.
|
||||||
|
|
|
@ -112,7 +112,7 @@ OAuth.prototype = {
|
||||||
if (queryIndex != -1) {
|
if (queryIndex != -1) {
|
||||||
urlSpec = url.slice(0, queryIndex);
|
urlSpec = url.slice(0, queryIndex);
|
||||||
dataParams = url.slice(queryIndex + 1).split("&")
|
dataParams = url.slice(queryIndex + 1).split("&")
|
||||||
.map(function(p) p.split("=").map(percentEncode));
|
.map(p => p.split("=").map(percentEncode));
|
||||||
}
|
}
|
||||||
this.log.info("in sign and send url = " + url + "\nurlSpec = " + urlSpec);
|
this.log.info("in sign and send url = " + url + "\nurlSpec = " + urlSpec);
|
||||||
this.log.info("dataParams = " + dataParams);
|
this.log.info("dataParams = " + dataParams);
|
||||||
|
@ -123,8 +123,8 @@ OAuth.prototype = {
|
||||||
let signatureBase =
|
let signatureBase =
|
||||||
aMethod + "&" + encodeURIComponent(urlSpec) + "&" +
|
aMethod + "&" + encodeURIComponent(urlSpec) + "&" +
|
||||||
params.concat(dataParams)
|
params.concat(dataParams)
|
||||||
.sort(function(a,b) (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0)
|
.sort((a, b) => (a[0] < b[0]) ? -1 : (a[0] > b[0]) ? 1 : 0)
|
||||||
.map(function(p) p.map(percentEncode).join("%3D"))
|
.map(p => p.map(percentEncode).join("%3D"))
|
||||||
.join("%26");
|
.join("%26");
|
||||||
|
|
||||||
this.log.info("sig base = " + signatureBase);
|
this.log.info("sig base = " + signatureBase);
|
||||||
|
@ -150,7 +150,7 @@ OAuth.prototype = {
|
||||||
params.push(["oauth_signature", signature]);
|
params.push(["oauth_signature", signature]);
|
||||||
|
|
||||||
let authorization =
|
let authorization =
|
||||||
"OAuth " + params.map(function (p) p[0] + "=\"" + p[1] + "\"").join(", ");
|
"OAuth " + params.map(p => p[0] + "=\"" + p[1] + "\"").join(", ");
|
||||||
let options = {
|
let options = {
|
||||||
headers: (aHeaders || []).concat([["Authorization", authorization]]),
|
headers: (aHeaders || []).concat([["Authorization", authorization]]),
|
||||||
postData: aPOSTData,
|
postData: aPOSTData,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче