Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit d270170

Browse files
committed
#231: code review for ABP filtering after spotting anomalies during testing
1 parent 9804e4e commit d270170

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

js/abp-filters.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ var makeFilter = function(s, tokenBeg) {
347347
}
348348
return new FilterSingleWildcard(s, tokenBeg);
349349
}
350-
if ( tokenBeg === false ) {
350+
if ( tokenBeg === 0 ) {
351351
return new FilterPlainPrefix0(s);
352352
}
353353
if ( tokenBeg === 1 ) {
@@ -369,7 +369,7 @@ var makeHostnameFilter = function(s, tokenBeg, hostname) {
369369
}
370370
return new FilterSingleWildcardHostname(s, tokenBeg, hostname);
371371
}
372-
if ( tokenBeg === false ) {
372+
if ( tokenBeg === 0 ) {
373373
return new FilterPlainPrefix0Hostname(s, hostname);
374374
}
375375
if ( tokenBeg === 1 ) {
@@ -391,7 +391,7 @@ var makeNotHostnameFilter = function(s, tokenBeg, hostname) {
391391
}
392392
return new FilterSingleWildcardNotHostname(s, tokenBeg, hostname);
393393
}
394-
if ( tokenBeg === false ) {
394+
if ( tokenBeg === 0 ) {
395395
return new FilterPlainPrefix0NotHostname(s, hostname);
396396
}
397397
if ( tokenBeg === 1 ) {
@@ -549,11 +549,11 @@ FilterParser.prototype.parseOptHostnames = function(raw) {
549549
}
550550
domain = httpsburi.domainFromHostname(hostname);
551551
if ( not ) {
552-
this.hostnames.push(hostname);
553-
this.domains.push(domain);
554-
} else {
555552
this.notHostnames.push(hostname);
556553
this.notDomains.push(domain);
554+
} else {
555+
this.hostnames.push(hostname);
556+
this.domains.push(domain);
557557
}
558558
}
559559
};

0 commit comments

Comments
 (0)