Skip to content

Commit

Permalink
[Firefox addon] Replace a bind(this) statement with an arrow functi…
Browse files Browse the repository at this point in the history
…on 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.
  • Loading branch information
Snuffleupagus committed Apr 30, 2017
1 parent a234ab4 commit 220357e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/firefox/content/PdfStreamConverter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 220357e

Please sign in to comment.