commit e89778c1ab4e3e596e3687f86fe47caf201cfc8f
parent ef1715e9ee622bf5655558ba593b6aa6f9488e6d
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 23 Jun 2017 04:59:48 -0400
Remove some code that's unnecessary now that we're Fx52+ everywhere
Diffstat:
7 files changed, 17 insertions(+), 63 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -1137,9 +1137,6 @@ Zotero.Item.prototype.removeCreator = function(orderIndex, allowMissing) {
// Define boolean properties
for (let name of ['deleted', 'inPublications']) {
let prop = '_' + name;
- // Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=449811 (Fixed in Fx51)
- let tmpName = name;
-
Zotero.defineProperty(Zotero.Item.prototype, name, {
get: function() {
if (!this.id) {
@@ -1154,12 +1151,12 @@ for (let name of ['deleted', 'inPublications']) {
val = !!val;
if (this[prop] == val) {
- Zotero.debug(Zotero.Utilities.capitalize(tmpName)
+ Zotero.debug(Zotero.Utilities.capitalize(name)
+ " state hasn't changed for item " + this.id);
return;
}
- this._markFieldChange(tmpName, !!this[prop]);
- this._changed[tmpName] = true;
+ this._markFieldChange(name, !!this[prop]);
+ this._changed[name] = true;
this[prop] = val;
}
});
diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js
@@ -115,10 +115,7 @@ Zotero.Debug = new function () {
slowSuffix = "\x1b[0m";
}
- // TODO: Replace with String.prototype.padStart once available (Fx48)
- while (("" + delta).length < 7) {
- delta = '0' + delta;
- }
+ delta = ("" + delta).padStart(7, "0")
deltaStr = "(" + slowPrefix + "+" + delta + slowSuffix + ")";
if (_store) {
diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js
@@ -338,8 +338,6 @@ Zotero.HTTP = new function() {
var useMethodjit = Components.utils.methodjit;
/** @ignore */
xmlhttp.onreadystatechange = function() {
- // XXX Remove when we drop support for Fx <24
- if(useMethodjit !== undefined) Components.utils.methodjit = useMethodjit;
_stateChange(xmlhttp, onDone, responseCharset);
};
@@ -424,8 +422,6 @@ Zotero.HTTP = new function() {
var useMethodjit = Components.utils.methodjit;
/** @ignore */
xmlhttp.onreadystatechange = function() {
- // XXX Remove when we drop support for Fx <24
- if(useMethodjit !== undefined) Components.utils.methodjit = useMethodjit;
_stateChange(xmlhttp, onDone, responseCharset);
};
@@ -486,8 +482,6 @@ Zotero.HTTP = new function() {
var useMethodjit = Components.utils.methodjit;
/** @ignore */
xmlhttp.onreadystatechange = function() {
- // XXX Remove when we drop support for Fx <24
- if(useMethodjit !== undefined) Components.utils.methodjit = useMethodjit;
_stateChange(xmlhttp, onDone);
};
@@ -523,8 +517,6 @@ Zotero.HTTP = new function() {
var useMethodjit = Components.utils.methodjit;
/** @ignore */
xmlhttp.onreadystatechange = function() {
- // XXX Remove when we drop support for Fx <24
- if(useMethodjit !== undefined) Components.utils.methodjit = useMethodjit;
_stateChange(xmlhttp, callback);
};
xmlhttp.send(null);
@@ -696,8 +688,6 @@ Zotero.HTTP = new function() {
var useMethodjit = Components.utils.methodjit;
/** @ignore */
xmlhttp.onreadystatechange = function() {
- // XXX Remove when we drop support for Fx <24
- if(useMethodjit !== undefined) Components.utils.methodjit = useMethodjit;
_stateChange(xmlhttp, callback);
};
xmlhttp.send(null);
@@ -733,8 +723,6 @@ Zotero.HTTP = new function() {
var useMethodjit = Components.utils.methodjit;
/** @ignore */
xmlhttp.onreadystatechange = function() {
- // XXX Remove when we drop support for Fx <24
- if(useMethodjit !== undefined) Components.utils.methodjit = useMethodjit;
_stateChange(xmlhttp, callback);
};
xmlhttp.send(null);
diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js
@@ -502,24 +502,16 @@ Zotero.Proxies = new function() {
* @return {Object} Object containing the content browser as 'browser' and a ChromeWindow as 'window'
*/
function _getBrowserAndWindow(channel) {
- // Firefox 45 and earlier
- if (Zotero.platformMajorVersion < 46) {
- var browser = channel.notificationCallbacks.getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
- }
- // Firefox 46 and up (non-e10s)
- else {
- let outerWindowID = channel.loadInfo.outerWindowID;
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
- .getService(Ci.nsIWindowMediator);
- let outerContentWin = wm.getOuterWindowWithId(outerWindowID);
- if (!outerContentWin) {
- return { browser: null, window: null };
- }
- var browser = outerContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
+ let outerWindowID = channel.loadInfo.outerWindowID;
+ var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
+ .getService(Ci.nsIWindowMediator);
+ let outerContentWin = wm.getOuterWindowWithId(outerWindowID);
+ if (!outerContentWin) {
+ return { browser: null, window: null };
}
+ var browser = outerContentWin.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
return {
browser,
window: browser.ownerDocument.defaultView
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -1598,8 +1598,7 @@ var ZoteroPane = new function()
*/
this.updateItemPaneButtons = function (selectedItems) {
if (!selectedItems.length) {
- // TODO: Remove Array.from after Firefox 45 support is removed
- Array.from(document.querySelectorAll('.zotero-item-pane-top-buttons')).forEach(x => x.hidden = true);
+ document.querySelectorAll('.zotero-item-pane-top-buttons').forEach(x => x.hidden = true);
return;
}
diff --git a/test/tests/dataDirectoryTest.js b/test/tests/dataDirectoryTest.js
@@ -218,14 +218,7 @@ describe("Zotero.DataDirectory", function () {
return Zotero.Promise.reject(new Error("Error"));
}
else {
- let args;
- if (Zotero.platformMajorVersion < 46) {
- args = Array.from(arguments);
- }
- else {
- args = arguments;
- }
- return origFunc(...args);
+ return origFunc(...arguments);
}
});
let stub1 = sinon.stub(Zotero.File, "reveal").returns(Zotero.Promise.resolve());
@@ -401,14 +394,7 @@ describe("Zotero.DataDirectory", function () {
return Zotero.Promise.reject(new Error("Error"));
}
else {
- let args;
- if (Zotero.platformMajorVersion < 46) {
- args = Array.from(arguments);
- }
- else {
- args = arguments;
- }
- return origFunc(...args);
+ return origFunc(...arguments);
}
});
diff --git a/test/tests/syncRunnerTest.js b/test/tests/syncRunnerTest.js
@@ -1039,12 +1039,7 @@ describe("Zotero.Sync.Runner", function () {
win = yield loadZoteroPane();
var doc = win.document;
- if (Zotero.platformMajorVersion >= 48) {
- var text = "".padStart(256, "a");
- }
- else {
- var text = Array(256).fill("a").join("");
- }
+ var text = "".padStart(256, "a");
var item = yield createDataObject('item', { itemType: 'note', note: text });
setResponse('keyInfo.fullAccess');