Bug 745445 - Remove arguments.callee from browser.js. r=dao
authorOHZEKI Tetsuharu <saneyuki.s.snyk@gmail.com>
Mon, 16 Apr 2012 18:35:34 -0400
changeset 91797 5668272cf028d02681313793fe4f8d113b310f4c
parent 91796 7a89be8dbecc75b35093cb58dae0e4f1ec5b3893
child 91798 b16ed4c13f5b8552c561a6c0791dfdf17a344a52
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdao
bugs745445
milestone14.0a1
Bug 745445 - Remove arguments.callee from browser.js. r=dao
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -934,18 +934,18 @@ const gFormSubmitObserver = {
             e.originalTarget.validationMessage;
         }
       }
     };
     element.addEventListener("input", inputHandler, false);
     element.addEventListener("blur", blurHandler, false);
 
     // One event to bring them all and in the darkness bind them.
-    this.panel.addEventListener("popuphiding", function(aEvent) {
-      aEvent.target.removeEventListener("popuphiding", arguments.callee, false);
+    this.panel.addEventListener("popuphiding", function onPopupHiding(aEvent) {
+      aEvent.target.removeEventListener("popuphiding", onPopupHiding, false);
       element.removeEventListener("input", inputHandler, false);
       element.removeEventListener("blur", blurHandler, false);
     }, false);
 
     this.panel.hidden = false;
 
     // We want to show the popup at the middle of checkbox and radio buttons
     // and where the content begin for the other elements.
@@ -3741,18 +3741,18 @@ function BrowserCustomizeToolbar()
     if (sheetFrame.getAttribute("src") == customizeURL)
       sheetFrame.contentWindow.location.reload()
     else
       sheetFrame.setAttribute("src", customizeURL);
 
     // Open the panel, but make it invisible until the iframe has loaded so
     // that the user doesn't see a white flash.
     panel.style.visibility = "hidden";
-    gNavToolbox.addEventListener("beforecustomization", function () {
-      gNavToolbox.removeEventListener("beforecustomization", arguments.callee, false);
+    gNavToolbox.addEventListener("beforecustomization", function onBeforeCustomization() {
+      gNavToolbox.removeEventListener("beforecustomization", onBeforeCustomization, false);
       panel.style.removeProperty("visibility");
     }, false);
     panel.openPopup(gNavToolbox, "after_start", 0, 0);
     return sheetFrame.contentWindow;
   } else {
     return window.openDialog(customizeURL,
                              "CustomizeToolbar",
                              "chrome,titlebar,toolbar,location,resizable,dependent",
@@ -5177,19 +5177,19 @@ var TabsProgressListener = {
     // pages have any privilege themselves.
     // We can't look for this during onLocationChange since at that point the
     // document URI is not yet the about:-uri of the error page.
 
     if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
         Components.isSuccessCode(aStatus) &&
         /^about:/.test(aWebProgress.DOMWindow.document.documentURI)) {
       aBrowser.addEventListener("click", BrowserOnClick, false);
-      aBrowser.addEventListener("pagehide", function () {
+      aBrowser.addEventListener("pagehide", function onPageHide() {
         aBrowser.removeEventListener("click", BrowserOnClick, false);
-        aBrowser.removeEventListener("pagehide", arguments.callee, true);
+        aBrowser.removeEventListener("pagehide", onPageHide, true);
       }, true);
 
       // We also want to make changes to page UI for unprivileged about pages.
       BrowserOnAboutPageLoad(aWebProgress.DOMWindow.document);
     }
   },
 
   onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
@@ -6917,18 +6917,18 @@ function BrowserOpenAddonsMgr(aView) {
     }
   }
 
   var newLoad = !switchToTabHavingURI("about:addons", true);
 
   if (aView) {
     // This must be a new load, else the ping/pong would have
     // found the window above.
-    Services.obs.addObserver(function (aSubject, aTopic, aData) {
-      Services.obs.removeObserver(arguments.callee, aTopic);
+    Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
+      Services.obs.removeObserver(observer, aTopic);
       aSubject.loadView(aView);
     }, "EM-loaded", false);
   }
 }
 
 function AddKeywordForSearchField() {
   var node = document.popupNode;
 
@@ -8325,18 +8325,18 @@ var gIdentityHandler = {
         .setConsumeRollupEvent(Ci.nsIPopupBoxObject.ROLLUP_CONSUME);
 
     // Update the popup strings
     this.setPopupMessages(this._identityBox.className);
 
     // Add the "open" attribute to the identity box for styling
     this._identityBox.setAttribute("open", "true");
     var self = this;
-    this._identityPopup.addEventListener("popuphidden", function (e) {
-      e.currentTarget.removeEventListener("popuphidden", arguments.callee, false);
+    this._identityPopup.addEventListener("popuphidden", function onPopupHidden(e) {
+      e.currentTarget.removeEventListener("popuphidden", onPopupHidden, false);
       self._identityBox.removeAttribute("open");
     }, false);
 
     // Now open the popup, anchored off the primary chrome element
     this._identityPopup.openPopup(this._identityBox, "bottomcenter topleft");
   },
 
   onPopupShown : function(event) {