Index: lib/elemHideEmulation.js |
diff --git a/lib/elemHideEmulation.js b/lib/elemHideEmulation.js |
index 54c98222a80b3cdd19e2bfa7ac88846b2e0ef1c4..24d520aae3ccfc97b6fc0d92ccf2f42af13f761e 100644 |
--- a/lib/elemHideEmulation.js |
+++ b/lib/elemHideEmulation.js |
@@ -15,25 +15,26 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+"use strict"; |
+ |
/** |
* @fileOverview Element hiding emulation implementation. |
*/ |
let {ElemHide} = require("elemHide"); |
-let {Filter} = require("filterClasses"); |
+let {Filter} = require("filterClasses"); |
-var filters = Object.create(null); |
+let filters = Object.create(null); |
/** |
* Container for element hiding emulation filters |
* @class |
*/ |
-let ElemHideEmulation = exports.ElemHideEmulation = |
-{ |
+let ElemHideEmulation = exports.ElemHideEmulation = { |
/** |
* Removes all known filters |
*/ |
- clear: function() |
+ clear() |
{ |
filters = Object.create(null); |
}, |
@@ -42,7 +43,7 @@ let ElemHideEmulation = exports.ElemHideEmulation = |
* Add a new element hiding emulation filter |
* @param {ElemHideEmulationFilter} filter |
*/ |
- add: function(filter) |
+ add(filter) |
{ |
filters[filter.text] = true; |
}, |
@@ -51,24 +52,25 @@ let ElemHideEmulation = exports.ElemHideEmulation = |
* Removes an element hiding emulation filter |
* @param {ElemHideEmulationFilter} filter |
*/ |
- remove: function(filter) |
+ remove(filter) |
{ |
delete filters[filter.text]; |
}, |
/** |
* Returns a list of all rules active on a particular domain |
- * @param {String} domain |
+ * @param {string} domain |
* @return {ElemHideEmulationFilter[]} |
*/ |
- getRulesForDomain: function(domain) |
+ getRulesForDomain(domain) |
{ |
let result = []; |
let keys = Object.getOwnPropertyNames(filters); |
for (let key of keys) |
{ |
let filter = Filter.fromText(key); |
- if (filter.isActiveOnDomain(domain) && !ElemHide.getException(filter, domain)) |
+ if (filter.isActiveOnDomain(domain) && |
+ !ElemHide.getException(filter, domain)) |
result.push(filter); |
} |
return result; |