mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1185893 - abuse of bind(this) with add/removeEventListener r=gijs
This commit is contained in:
parent
a4e008a44f
commit
80221923ab
@ -332,7 +332,7 @@ WindowListener.prototype = {
|
||||
|
||||
let domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
domwindow.addEventListener("load", function onLoad(aEvent) {
|
||||
let onLoad = aEvent => {
|
||||
is(domwindow.document.location.href, this.test_url,
|
||||
"Opened Window is expected: "+ this.test_title);
|
||||
if (this.callback_onSuccess) {
|
||||
@ -352,7 +352,8 @@ WindowListener.prototype = {
|
||||
domwindow.close();
|
||||
executeSoon(this.callBack_onFinalize);
|
||||
}
|
||||
}.bind(this), true);
|
||||
};
|
||||
domwindow.addEventListener("load", onLoad, true);
|
||||
},
|
||||
onCloseWindow: function(aXULWindow) {},
|
||||
onWindowTitleChange: function(aXULWindow, aNewTitle) {},
|
||||
|
@ -898,7 +898,7 @@ let MozLoopServiceInternal = {
|
||||
return;
|
||||
}
|
||||
|
||||
chatbox.addEventListener("DOMContentLoaded", function loaded(event) {
|
||||
let loaded = event => {
|
||||
if (event.target != chatbox.contentDocument) {
|
||||
return;
|
||||
}
|
||||
@ -987,7 +987,8 @@ let MozLoopServiceInternal = {
|
||||
pc_static.registerPeerConnectionLifecycleCallback(onPCLifecycleChange);
|
||||
|
||||
UITour.notify("Loop:ChatWindowOpened");
|
||||
}.bind(this), true);
|
||||
};
|
||||
chatbox.addEventListener("DOMContentLoaded", loaded, true);
|
||||
};
|
||||
|
||||
let chatboxInstance = Chat.open(null, origin, "", url, undefined, undefined,
|
||||
|
@ -292,7 +292,7 @@ Cookies.prototype = {
|
||||
_readCookieFile: function C__readCookieFile(aFile, aCallback) {
|
||||
let fileReader = Cc["@mozilla.org/files/filereader;1"].
|
||||
createInstance(Ci.nsIDOMFileReader);
|
||||
fileReader.addEventListener("loadend", (function onLoadEnd() {
|
||||
let onLoadEnd = () => {
|
||||
fileReader.removeEventListener("loadend", onLoadEnd, false);
|
||||
|
||||
if (fileReader.readyState != fileReader.DONE) {
|
||||
@ -310,7 +310,8 @@ Cookies.prototype = {
|
||||
} finally {
|
||||
aCallback(success);
|
||||
}
|
||||
}).bind(this), false);
|
||||
};
|
||||
fileReader.addEventListener("loadend", onLoadEnd, false);
|
||||
fileReader.readAsText(new File(aFile));
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user