Bug 1332863 - Turn on strict mode for mobile session store. r?sebastian
MozReview-Commit-ID: 20KRW4yxPm4
--- 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