Bug 1094429 - fix strict warning in sanitize.js, r=gavin
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 06 Nov 2014 11:53:34 +0000
changeset 214415 347c76e80e6fd7eff7a19e1796ead4d645cecfc9
parent 214414 0fa23eddfe123000fee67dc5c557342a4c4df62f
child 214416 5e34ddeb2042ef4d35a578f09c23c30e47a546d4
push id27781
push userkwierso@gmail.com
push dateFri, 07 Nov 2014 02:47:58 +0000
treeherdermozilla-central@f54c94033c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs1094429
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
     }