Bug 1319934 - Remove String generics uses in addon-sdk. r=mossop
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 24 Nov 2016 13:17:19 -0800
changeset 324751 9607364780c2ad20c0770b62064c66f6ffddbd82
parent 324750 754af8c55a9d7f6e786eb1258192fbdd8b364a23
child 324752 8361e025e4c796b90027fe7c88018780b4c2a4ee
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmossop
bugs1319934
milestone53.0a1
Bug 1319934 - Remove String generics uses in addon-sdk. r=mossop
addon-sdk/source/lib/sdk/tabs/utils.js
addon-sdk/source/lib/sdk/url.js
--- a/addon-sdk/source/lib/sdk/tabs/utils.js
+++ b/addon-sdk/source/lib/sdk/tabs/utils.js
@@ -202,17 +202,17 @@ function getBrowserForTab(tab) {
   return tab.linkedBrowser;
 }
 exports.getBrowserForTab = getBrowserForTab;
 
 function getTabId(tab) {
   if (tab.browser) // fennec
     return tab.id
 
-  return String.split(tab.linkedPanel, 'panel').pop();
+  return String(tab.linkedPanel).split('panel').pop();
 }
 exports.getTabId = getTabId;
 
 function getTabForId(id) {
   return getTabs().find(tab => getTabId(tab) === id) || null;
 }
 exports.getTabForId = getTabForId;
 
--- a/addon-sdk/source/lib/sdk/url.js
+++ b/addon-sdk/source/lib/sdk/url.js
@@ -331,17 +331,17 @@ var isValidURI = exports.isValidURI = fu
   }
   catch(e) {
     return false;
   }
   return true;
 }
 
 function isLocalURL(url) {
-  if (String.indexOf(url, './') === 0)
+  if (String(url).indexOf('./') === 0)
     return true;
 
   try {
     return ['resource', 'data', 'chrome'].indexOf(URL(url).scheme) > -1;
   }
   catch(e) {}
 
   return false;