Bug 834400 - Use bind() in download callbacks. r=mfinkle a=bajaj
--- a/mobile/android/chrome/content/aboutDownloads.js
+++ b/mobile/android/chrome/content/aboutDownloads.js
@@ -417,17 +417,17 @@ let Downloads = {
openDownload: function dl_openDownload(aItem) {
this._getDownloadForElement(aItem, function(aDownload) {
try {
let f = aDownload.targetFile;
if (f) f.launch();
} catch (ex) {
this.logError("openDownload() " + ex, aDownload);
}
- });
+ }.bind(this));
},
removeDownload: function dl_removeDownload(aItem) {
this._getDownloadForElement(aItem, function(aDownload) {
let f = null;
try {
f = aDownload.targetFile;
} catch (ex) {
@@ -436,17 +436,17 @@ let Downloads = {
f = { leafName: "" };
}
aDownload.remove();
try {
if (f) f.remove();
} catch (ex) {
this.logError("removeDownload() " + ex, aDownload);
}
- });
+ }.bind(this));
aItem.parentNode.removeChild(aItem);
},
deleteAll: function dl_deleteAll() {
let title = gStrings.GetStringFromName("downloadAction.deleteAll");
let messageForm = gStrings.GetStringFromName("downloadMessage.deleteAll");
let elements = document.body.querySelectorAll("li[state='" + this._dlmgr.DOWNLOAD_FINISHED + "']," +
"li[state='" + this._dlmgr.DOWNLOAD_CANCELED + "']," +