Bug 1319939 - Remove String generics uses in toolkit/mozapps/extensions/content. r=rhelmer
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 29 Nov 2016 14:22:07 -0800
changeset 324748 5897fbfa16c965eed37783bbe0c2edfd919edcf6
parent 324747 2a34ba3cdc1d9c7158cb43bad2eb622dc72f9542
child 324749 2e6d1dafee00c988288f4b8e3023d4df7bf792fc
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersrhelmer
bugs1319939
milestone53.0a1
Bug 1319939 - Remove String generics uses in toolkit/mozapps/extensions/content. r=rhelmer
toolkit/mozapps/extensions/content/blocklist.js
toolkit/mozapps/extensions/content/extensions.js
--- a/toolkit/mozapps/extensions/content/blocklist.js
+++ b/toolkit/mozapps/extensions/content/blocklist.js
@@ -23,17 +23,17 @@ function init() {
               createBundle("chrome://mozapps/locale/update/updates.properties");
   let cancelButton = document.documentElement.getButton("cancel");
   cancelButton.setAttribute("label", bundle.GetStringFromName("restartLaterButton"));
   cancelButton.setAttribute("accesskey",
                             bundle.GetStringFromName("restartLaterButton.accesskey"));
 
   var richlist = document.getElementById("addonList");
   var list = gArgs.list;
-  list.sort(function(a, b) { return String.localeCompare(a.name, b.name); });
+  list.sort((a, b) => String(a.name).localeCompare(b.name));
   for (let listItem of list) {
     let item = document.createElement("richlistitem");
     item.setAttribute("name", listItem.name);
     item.setAttribute("version", listItem.version);
     item.setAttribute("icon", listItem.icon);
     if (listItem.blocked) {
       item.setAttribute("class", "hardBlockedAddon");
       hasHardBlocks = true;
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1889,17 +1889,17 @@ var gCategories = {
       if (aPriority < nodePriority)
         break;
       // If the new type's priority is lower than this one then this is isn't
       // the insertion point
       if (aPriority > nodePriority)
         continue;
       // If the priorities are equal and the new type's name is earlier
       // alphabetically then this is the insertion point
-      if (String.localeCompare(aName, node.getAttribute("name")) < 0)
+      if (String(aName).localeCompare(node.getAttribute("name")) < 0)
         break;
     }
 
     this.node.insertBefore(category, node);
   },
 
   _removeCategory: function(aId) {
     var category = document.getElementById("category-" + aId);