From 220357eb78d55ece3d84b0556a2a7fc28810a7f6 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 30 Apr 2017 13:21:37 +0200 Subject: [PATCH] [Firefox addon] Replace a `bind(this)` statement with an arrow function in `PdfStreamConverter.jsm` (issue 8343) Please note that I used the addon debugger to set a breakpoint in the `unload` function, in order to ensure that `this` still correctly refers to the `FindEventManager` scope. --- extensions/firefox/content/PdfStreamConverter.jsm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm index 451d552558955..35e6a6ca3376d 100644 --- a/extensions/firefox/content/PdfStreamConverter.jsm +++ b/extensions/firefox/content/PdfStreamConverter.jsm @@ -804,10 +804,10 @@ class FindEventManager { } bind() { - var unload = function(e) { + var unload = (evt) => { this.unbind(); - this.contentWindow.removeEventListener(e.type, unload); - }.bind(this); + this.contentWindow.removeEventListener(evt.type, unload); + }; this.contentWindow.addEventListener("unload", unload); // We cannot directly attach listeners to for the find events