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; |