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

Unified Diff: lib/url.js

Issue 29808581: Noissue - Use destructuring (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created June 15, 2018, 5:47 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/url.js
===================================================================
--- a/lib/url.js
+++ b/lib/url.js
@@ -29,17 +29,17 @@
* @param {?Frame} frame
* @param {URL} [originUrl]
* @return {string}
*/
exports.extractHostFromFrame = (frame, originUrl) =>
{
for (; frame; frame = frame.parent)
{
- let hostname = frame.url.hostname;
+ let {hostname} = frame.url;
if (hostname)
return hostname;
}
return originUrl ? originUrl.hostname : "";
};
function isDomain(hostname)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld