Bug 1108412 - Fix strict mode warning about assigning to an undeclared variable `port` in nsPromper.js. r=dolske
authorChris Peterson <cpeterson@mozilla.com>
Sun, 07 Dec 2014 00:30:13 -0800
changeset 219053 350917941d640cc9841e76771c823698bb9f6ec8
parent 219052 824d26fdcb28fe553b3efa43026a7ca8d37f107c
child 219054 57760cba14025e5940b9ea87099660f0b791ace7
push id27954
push userryanvm@gmail.com
push dateWed, 10 Dec 2014 21:10:24 +0000
treeherdermozilla-central@0cf461e62ce5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs1108412
milestone37.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 1108412 - Fix strict mode warning about assigning to an undeclared variable `port` in nsPromper.js. r=dolske
toolkit/components/prompts/src/nsPrompter.js
--- a/toolkit/components/prompts/src/nsPrompter.js
+++ b/toolkit/components/prompts/src/nsPrompter.js
@@ -1,12 +1,13 @@
 /* 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 Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
@@ -16,17 +17,17 @@ function Prompter() {
     // Note that EmbedPrompter clones this implementation.
 }
 
 Prompter.prototype = {
     classID          : Components.ID("{1c978d25-b37f-43a8-a2d6-0c7a239ead87}"),
     QueryInterface   : XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIPromptService, Ci.nsIPromptService2]),
 
 
-    /* ----------  private memebers  ---------- */
+    /* ----------  private members  ---------- */
 
     pickPrompter : function (domWin) {
         return new ModalPrompter(domWin);
     },
 
 
     /* ----------  nsIPromptFactory  ---------- */
 
@@ -205,17 +206,17 @@ let PromptUtilsTemp = {
 
     // Copied from login manager
     getFormattedHostname : function (uri) {
         let scheme = uri.scheme;
         let hostname = scheme + "://" + uri.host;
 
         // If the URI explicitly specified a port, only include it when
         // it's not the default. (We never want "http://foo.com:80")
-        port = uri.port;
+        let port = uri.port;
         if (port != -1) {
             let handler = Services.io.getProtocolHandler(scheme);
             if (port != handler.defaultPort)
                 hostname += ":" + port;
         }
 
         return hostname;
     },