Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/utils.js

Issue 29339346: Noissue - Removed obsolete nsIURI compatbility code (Closed)
Patch Set: Created April 4, 2016, 11:20 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/compat.js ('K') | « lib/compat.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/utils.js
===================================================================
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -55,9 +55,22 @@
},
makeURI: function(url)
{
- return Services.io.newURI(url);
+ let urlObj;
+ try
+ {
+ urlObj = new URL(url);
+ }
+ catch (e)
Sebastian Noack 2016/04/04 11:22:26 We previously didn't handle exceptions here, but w
+ {
+ return null;
+ }
+
+ return {
+ spec: urlObj.href,
+ scheme: urlObj.protocol,
+ host: urlObj.hostname
+ };
},
-
checkLocalePrefixMatch: function(prefixes)
{
if (!prefixes)
« lib/compat.js ('K') | « lib/compat.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld