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

Unified Diff: lib/url.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Created Jan. 13, 2017, 12:11 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
« chrome/ext/common.js ('K') | « 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 4ea741dbbfee3134f421426713b877edf6f39364..d81e8f881da726324dc221e9f8e6f2f59edad5b5 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -28,7 +28,7 @@ let getDecodedHostname =
* @return {string}
* @static
*/
-exports.getDecodedHostname = function(url)
+exports.getDecodedHostname = url =>
{
let hostname = url.hostname;
@@ -46,7 +46,7 @@ exports.getDecodedHostname = function(url)
* @param {Frame} frame
* @return {string}
*/
-exports.extractHostFromFrame = function(frame)
+exports.extractHostFromFrame = frame =>
{
for (; frame; frame = frame.parent)
{
@@ -65,7 +65,7 @@ exports.extractHostFromFrame = function(frame)
* @param {URL} url
* @return {string}
*/
-exports.stringifyURL = function(url)
+exports.stringifyURL = url =>
{
let protocol = url.protocol;
let href = url.href;
@@ -102,7 +102,7 @@ function isDomain(hostname)
* @param {string} documentHost The IDN-decoded hostname of the document
* @return {Boolean}
*/
-exports.isThirdParty = function(url, documentHost)
+exports.isThirdParty = (url, documentHost) =>
{
let requestHost = getDecodedHostname(url).replace(/\.+$/, "");
documentHost = documentHost.replace(/\.+$/, "");
« chrome/ext/common.js ('K') | « lib/tldjs.js ('k') | lib/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld