aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgorhill <rhill@raymondhill.net>2015-01-21 08:59:23 -0500
committergorhill <rhill@raymondhill.net>2015-01-21 08:59:23 -0500
commit4edfae4b94e5bc8109bc4eb50ba0f7aba6dda0f4 (patch)
treee730666764268431ca81db391ee3e490e5cb2bbc /src
parenta64bca0fa64ffe1e48029a6ef15865f0fe830b44 (diff)
downloaduBlock-4edfae4b94e5bc8109bc4eb50ba0f7aba6dda0f4.zip
uBlock-4edfae4b94e5bc8109bc4eb50ba0f7aba6dda0f4.tar.gz
uBlock-4edfae4b94e5bc8109bc4eb50ba0f7aba6dda0f4.tar.bz2
code review: jshint'ed
Diffstat (limited to 'src')
-rw-r--r--src/js/background.js1
-rw-r--r--src/js/pagestore.js1
-rw-r--r--src/js/static-net-filtering.js11
-rw-r--r--src/js/traffic.js1
4 files changed, 7 insertions, 7 deletions
diff --git a/src/js/background.js b/src/js/background.js
index 5f09784..b47fe0a 100644
--- a/src/js/background.js
+++ b/src/js/background.js
@@ -19,6 +19,7 @@
Home: https://github.com/gorhill/uBlock
*/
+/* global vAPI */
/* exported µBlock */
/******************************************************************************/
diff --git a/src/js/pagestore.js b/src/js/pagestore.js
index 2b94bc3..d91c81b 100644
--- a/src/js/pagestore.js
+++ b/src/js/pagestore.js
@@ -261,7 +261,6 @@ NetFilteringResultCacheEntry.factory = function(result, type) {
/******************************************************************************/
// To mitigate memory churning
-var uidGenerator = 1;
var netFilteringCacheJunkyard = [];
var netFilteringCacheJunkyardMax = 10;
diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js
index 1e81d4a..3e106a9 100644
--- a/src/js/static-net-filtering.js
+++ b/src/js/static-net-filtering.js
@@ -68,7 +68,7 @@ var typeNameToTypeValue = {
'inline-script': 14 << 4,
'popup': 15 << 4
};
-var typeOtherToTypeValue = typeNameToTypeValue['other'];
+var typeOtherToTypeValue = typeNameToTypeValue.other;
const BlockAnyTypeAnyParty = BlockAction | AnyType | AnyParty;
const BlockAnyType = BlockAction | AnyType;
@@ -1756,9 +1756,10 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r
pageHostname = context.pageHostname || '';
// Be prepared to support unknown types
- var type = typeNameToTypeValue[requestType] || typeOtherToTypeValue;
- var categories = this.categories;
+ var bf = false;
var bucket;
+ var categories = this.categories;
+ var type = typeNameToTypeValue[requestType] || typeOtherToTypeValue;
// Tokenize only once
this.tokenize(url);
@@ -1779,7 +1780,6 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r
}
// Test against block filters
- bf = false;
if ( bucket = categories[this.makeCategoryKey(BlockAnyParty | type)] ) {
bf = this.matchTokens(bucket, url);
}
@@ -1855,12 +1855,13 @@ FilterContainer.prototype.matchString = function(context) {
// This will be used by hostname-based filters
pageHostname = context.pageHostname || '';
+ var bf, bucket;
var categories = this.categories;
- var bucket;
// Tokenize only once
this.tokenize(url);
+
// https://github.com/gorhill/uBlock/issues/139
// Test against important block filters.
// The purpose of the `important` option is to reverse the order of
diff --git a/src/js/traffic.js b/src/js/traffic.js
index 0bd3182..7e61e3b 100644
--- a/src/js/traffic.js
+++ b/src/js/traffic.js
@@ -299,7 +299,6 @@ var headerValue = function(headers, name) {
/******************************************************************************/
var headerStartsWith = function(headers, prefix) {
- var prefixLen = prefix.length;
var i = headers.length;
while ( i-- ) {
if ( headers[i].name.toLowerCase().lastIndexOf(prefix, 0) === 0 ) {