Bug 1094429 - fix strict warning in sanitize.js, r=gavin
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 06 Nov 2014 11:53:34 +0000
changeset 214225 347c76e80e6fd7eff7a19e1796ead4d645cecfc9
parent 214224 0fa23eddfe123000fee67dc5c557342a4c4df62f
child 214226 5e34ddeb2042ef4d35a578f09c23c30e47a546d4
push id9807
push usergijskruitbosch@gmail.com
push dateThu, 06 Nov 2014 12:05:10 +0000
treeherderfx-team@5e34ddeb2042 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs1094429
milestone36.0a1
Bug 1094429 - fix strict warning in sanitize.js, r=gavin
browser/base/content/sanitize.js
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -69,28 +69,26 @@ Sanitizer.prototype = {
     // Ensure open windows get cleared first, if they're in our list, so that they don't stick
     // around in the recently closed windows list, and so we can cancel the whole thing
     // if the user selects to keep a window open from a beforeunload prompt.
     let openWindowsIndex = itemsToClear.indexOf("openWindows");
     if (openWindowsIndex != -1) {
       itemsToClear.splice(openWindowsIndex, 1);
       let item = this.items.openWindows;
 
-      function onWindowsCleaned() {
+      let ok = item.clear(() => {
         try {
           let clearedPromise = this.sanitize(itemsToClear);
           clearedPromise.then(deferred.resolve, deferred.reject);
         } catch(e) {
           let error = "Sanitizer threw after closing windows: " + e;
           Cu.reportError(error);
           deferred.reject(error);
         }
-      }
-
-      let ok = item.clear(onWindowsCleaned.bind(this));
+      });
       // When cancelled, reject immediately
       if (!ok) {
         deferred.reject("Sanitizer canceled closing windows");
       }
 
       return deferred.promise;
     }