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

Unified Diff: lib/whitelisting.js

Issue 6467101665525760: Noissue - Use named functions in lib/whitelisting.js for consistency (Closed)
Patch Set: Created Jan. 21, 2015, 7:58 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
« 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/whitelisting.js
===================================================================
--- a/lib/whitelisting.js
+++ b/lib/whitelisting.js
@@ -20,7 +20,7 @@
let pagesWithKey = new ext.PageMap();
-let isWhitelisted = exports.isWhitelisted = function(url, parentUrl, type, key)
+function isWhitelisted(url, parentUrl, type, key)
{
let filter = defaultMatcher.matchesAny(
stripFragmentFromURL(url),
@@ -31,9 +31,10 @@
);
return (filter instanceof WhitelistFilter ? filter : null);
-};
+}
+exports.isWhitelisted = isWhitelisted;
-let isFrameWhitelisted = exports.isFrameWhitelisted = function(page, frame, type)
+function isFrameWhitelisted(page, frame, type)
{
for (; frame != null; frame = frame.parent)
{
@@ -43,9 +44,10 @@
}
return false;
-};
+}
+exports.isFrameWhitelisted = isFrameWhitelisted;
-let getKey = exports.getKey = function(page, frame)
+function getKey(page, frame)
kzar 2015/01/21 14:12:55 Shouldn't getKey be declared before isFrameWhiteli
Sebastian Noack 2015/01/21 14:24:49 Yes, we usually declare functions before they are
{
let urlsWithKey = pagesWithKey.get(page);
if (!urlsWithKey)
@@ -59,8 +61,9 @@
return null;
}
+exports.getKey = getKey;
-let verifyKey = function(key, signature, url)
+function verifyKey(key, signature, url)
{
url = new URL(url);
let params = [
@@ -70,9 +73,9 @@
];
return verifySignature(key, signature, params.join("\0"));
-};
+}
-let recordKey = function(page, url, key)
+function recordKey(page, url, key)
{
let urlsWithKey = pagesWithKey.get(page);
@@ -83,9 +86,9 @@
}
urlsWithKey[url] = key;
-};
+}
-let processKey = exports.processKey = function(token, page, frame)
+function processKey(token, page, frame)
{
let url = stripFragmentFromURL(frame.url);
@@ -97,4 +100,5 @@
if (verifyKey(key, signature, url))
recordKey(page, url, key);
-};
+}
+exports.processKey = processKey;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld