From 65a8000657ceb2a0650ce6d70e92eafe378aa858 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 23 Oct 2014 19:37:59 -0400 Subject: [PATCH] fixed parsing of partial rules --- src/{ubiquitous-rules.html => hosts-files.html} | 0 src/js/{ubiquitous-rules.js => hosts-files.js} | 0 src/js/matrix.js | 10 +++++----- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/{ubiquitous-rules.html => hosts-files.html} (100%) rename src/js/{ubiquitous-rules.js => hosts-files.js} (100%) diff --git a/src/ubiquitous-rules.html b/src/hosts-files.html similarity index 100% rename from src/ubiquitous-rules.html rename to src/hosts-files.html diff --git a/src/js/ubiquitous-rules.js b/src/js/hosts-files.js similarity index 100% rename from src/js/ubiquitous-rules.js rename to src/js/hosts-files.js diff --git a/src/js/matrix.js b/src/js/matrix.js index 6870ff2..a6347df 100644 --- a/src/js/matrix.js +++ b/src/js/matrix.js @@ -341,12 +341,12 @@ Matrix.prototype.evaluateCellZXY = function(srcHostname, desHostname, type) { var pos; var d = desHostname; - var firstPartDesDomain = extractFirstPartyDesDomain(srcHostname, desHostname); + var firstPartyDesDomain = extractFirstPartyDesDomain(srcHostname, desHostname); // Ancestor cells, up to 1st-party destination domain - if ( firstPartDesDomain !== '' ) { + if ( firstPartyDesDomain !== '' ) { for (;;) { - if ( d === firstPartDesDomain ) { + if ( d === firstPartyDesDomain ) { break; } d = d.slice(d.indexOf('.') + 1); @@ -643,7 +643,7 @@ Matrix.prototype.fromString = function(text, append) { fieldVal = fields[2]; - if ( fieldVal !== null ) { + if ( fieldVal !== undefined ) { type = fieldVal; // Unknown type: reject if ( typeBitOffsets.hasOwnProperty(type) === false ) { @@ -655,7 +655,7 @@ Matrix.prototype.fromString = function(text, append) { fieldVal = fields[3]; - if ( fieldVal !== null ) { + if ( fieldVal !== undefined ) { // Unknown state: reject if ( nameToStateMap.hasOwnProperty(fieldVal) === false ) { continue;