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

Unified Diff: lib/url.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Rebased Created March 17, 2017, 12:41 p.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
« no previous file with comments | « lib/tldjs.js ('k') | lib/utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/url.js
diff --git a/lib/url.js b/lib/url.js
index 7614799423094d75f900f13e7f0cd35919c8b950..2c3a088edabd9c67fc98378c488a086cfacbe4d1 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -32,7 +32,7 @@ let getDecodedHostname =
*/
exports.getDecodedHostname = url =>
{
- let hostname = url.hostname;
+ let {hostname} = url;
if (hostname.indexOf("xn--") == -1)
return hostname;
@@ -69,12 +69,11 @@ exports.extractHostFromFrame = frame =>
*/
exports.stringifyURL = url =>
{
- let protocol = url.protocol;
- let href = url.href;
+ let {protocol, href} = url;
if (protocol == "http:" || protocol == "https:")
{
- let hostname = url.hostname;
+ let {hostname} = url;
if (hostname.indexOf("xn--") != -1)
href = href.replace(hostname, punycode.toUnicode(hostname));
« no previous file with comments | « lib/tldjs.js ('k') | lib/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld