Bug 1321274 - Remove usage of javascript String generics: mail. r=mkmelin
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 01 Dec 2016 22:59:38 +0100
changeset 20789 fa53301f7178e84b38403e83dfaa7f71a28f357a
parent 20788 14dc361515067ad74811e70543cc4acc7266e212
child 20790 a1ff30b2483661bb2eede5649de61b5501e3063f
push id12597
push userarchaeopteryx@coole-files.de
push dateThu, 01 Dec 2016 22:00:09 +0000
treeherdercomm-central@fa53301f7178 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1321274
Bug 1321274 - Remove usage of javascript String generics: mail. r=mkmelin MozReview-Commit-ID: D0DqzGvRVFR
mail/components/newmailaccount/content/accountProvisioner.js
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -412,17 +412,17 @@ var EmailAccountProvisioner = {
       node.style.display = "none";
     }
     document.getElementById("instructions").classList.add("hide");
     EmailAccountProvisioner.saveName();
 
     // Here's where we do some kind of hack-y client-side sanitization.
     // Believe it or not, this is how you sanitize stuff to HTML elements
     // via jQuery.
-    // let name = String.trim($("<div></div>").text($("#name").val()).html());
+    // let name = $("<div></div>").text($("#name").val()).html().trim();
     // Not quite sure what this was for, but here's the hack converted
     // to vanilla JS.
     let nameElement = document.getElementById("name");
     let div = document.createElement("div");
     div.textContent = nameElement.value;
     let name = div.innerHTML.trim();
     if (!name) {
       nameElement.select();
@@ -456,17 +456,17 @@ var EmailAccountProvisioner = {
     };
     request.ontimeout = () => {
       gLog.info("Timeout of XMLHttpRequest fetching address data.");
       EmailAccountProvisioner.showSearchError();
     }
     request.onloadend = function() {
       // Also called if we timeout.
       let firstAndLastName = document.getElementById("FirstAndLastName");
-      firstAndLastName.innerHTML = String.trim(firstname + " " + lastname);
+      firstAndLastName.innerHTML = (firstname + " " + lastname).trim();
       EmailAccountProvisioner.searchEnabled(true);
       EmailAccountProvisioner.spinning(false);
     };
     request.timeout = CONNECTION_TIMEOUT;
     request.send(null);
   },
 
   /**
@@ -496,17 +496,17 @@ var EmailAccountProvisioner = {
     }
 
     gLog.info("Opening up a contentTab with the order form.");
     // Then open a content tab.
     let mail3Pane = Services.wm.getMostRecentWindow("mail:3pane");
     let tabmail = mail3Pane.document.getElementById("tabmail");
     tabmail.openTab("accountProvisionerTab", {
       contentPage: url,
-      realName: String.trim(firstName + " " + lastName),
+      realName: (firstName + " " + lastName).trim(),
       email: email,
       searchEngine: provider.search_engine,
       onLoad: function (aEvent, aBrowser) {
         window.close();
       },
     });
 
     // Wait for the handler to close us.