Bug 1319938 - Remove String generics uses in toolkit/components/extensions. r=aswan
authorAndré Bargull <andre.bargull@gmail.com>
Tue, 29 Nov 2016 14:30:06 -0800
changeset 324754 a42ceecb226008ea2b33701ebfd8986e05521b7d
parent 324753 1e6c0d61f55400a54d4f889817c77584af6a92ef
child 324755 26551118afb7716ed8f789acf84487c9f184286c
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersaswan
bugs1319938
milestone53.0a1
Bug 1319938 - Remove String generics uses in toolkit/components/extensions. r=aswan
toolkit/components/extensions/Extension.jsm
toolkit/components/extensions/test/mochitest/head_cookies.js
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -469,17 +469,17 @@ this.ExtensionData = class {
 
     return null;
   }
 
   // Normalizes a Chrome-compatible locale code to the appropriate
   // Gecko-compatible variant. Currently, this means simply
   // replacing underscores with hyphens.
   normalizeLocaleCode(locale) {
-    return String.replace(locale, /_/g, "-");
+    return locale.replace(/_/g, "-");
   }
 
   // Reads the locale file for the given Gecko-compatible locale code, and
   // stores its parsed contents in |this.localeMessages.get(locale)|.
   readLocaleFile(locale) {
     return Task.spawn(function* () {
       let locales = yield this.promiseLocales();
       let dir = locales.get(locale) || locale;
--- a/toolkit/components/extensions/test/mochitest/head_cookies.js
+++ b/toolkit/components/extensions/test/mochitest/head_cookies.js
@@ -117,17 +117,17 @@ function* testCookies(options) {
 
 
   function getCookies(host) {
     let cookies = [];
     let enum_ = cookieSvc.getCookiesFromHost(host, {});
     while (enum_.hasMoreElements()) {
       cookies.push(enum_.getNext().QueryInterface(SpecialPowers.Ci.nsICookie2));
     }
-    return cookies.sort((a, b) => String.localeCompare(a.name, b.name));
+    return cookies.sort((a, b) => a.name.localeCompare(b.name));
   }
 
   let cookies = getCookies(options.domain);
   info(`Cookies: ${cookies.map(c => `${c.name}=${c.value}`)}`);
 
   if (options.shouldPass) {
     is(cookies.length, 2, "expected two cookies for host");