Bug 1332863 - Turn on strict mode for mobile session store. r?sebastian draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 21 Jan 2017 19:58:57 +0100
changeset 464683 8aa5d4a1254763f19de120fe5381c698871e5d91
parent 464682 c20c73a9bfcda6a70ce4c757e9f2e276cb138045
child 542961 54f517f13c9ffe7cbb599528ac8f133f22308940
push id42399
push usermozilla@buttercookie.de
push dateSat, 21 Jan 2017 21:17:25 +0000
reviewerssebastian
bugs1332863
milestone53.0a1
Bug 1332863 - Turn on strict mode for mobile session store. r?sebastian MozReview-Commit-ID: 20KRW4yxPm4
mobile/android/components/SessionStore.js
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -1,11 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+"use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
@@ -195,20 +196,21 @@ SessionStore.prototype = {
         observerService.addObserver(this, "Tabs:OpenMultiple", true);
         break;
       case "final-ui-startup":
         observerService.removeObserver(this, "final-ui-startup");
         this.init();
         break;
       case "domwindowopened": {
         let window = aSubject;
-        window.addEventListener("load", () => {
+        let onLoad = () => {
+          window.removeEventListener("load", onLoad);
           this.onWindowOpen(window);
-          window.removeEventListener("load", arguments.callee);
-        });
+        };
+        window.addEventListener("load", onLoad);
         break;
       }
       case "domwindowclosed": // catch closed windows
         this.onWindowClose(aSubject);
         break;
       case "quit-application-requested":
         log("quit-application-requested");
         // Get a current snapshot of all windows