Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/elemHide.js

Issue 29775605: Noissue - Update JSDoc to mark optionals in lib/elemHide.js (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created May 9, 2018, 5:15 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHide.js
===================================================================
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -37,21 +37,24 @@
* @type {Map.<string,Filter>}
*/
let filterBySelector = new Map();
/**
* This array caches the keys of filterBySelector table (selectors
* which unconditionally apply on all domains). It will be null if the
* cache needs to be rebuilt.
+ * @type {?string[]}
*/
let unconditionalSelectors = null;
/**
* Map to be used instead when a filter has a blank domains property.
+ * @type {Map.<string,boolean>}
+ * @const
*/
let defaultDomains = new Map([["", true]]);
/**
* Set containing known element hiding and exception filters
* @type {Set.<ElemHideBase>}
*/
let knownFilters = new Set();
@@ -180,18 +183,18 @@
knownFilters.delete(filter);
FilterNotifier.emit("elemhideupdate");
},
/**
* Checks whether an exception rule is registered for a filter on a particular
* domain.
* @param {Filter} filter
- * @param {string} docDomain
- * @return {ElemHideException}
+ * @param {?string} docDomain
+ * @return {?ElemHideException}
*/
getException(filter, docDomain)
{
let list = exceptions.get(filter.selector);
if (!list)
return null;
for (let i = list.length - 1; i >= 0; i--)
@@ -212,28 +215,34 @@
if (!unconditionalSelectors)
unconditionalSelectors = [...filterBySelector.keys()];
return unconditionalSelectors.slice();
},
/**
* Constant used by getSelectorsForDomain to return all selectors applying to
* a particular hostname.
+ * @type {number}
Manish Jethani 2018/05/09 17:16:57 Unrelated but helpful.
+ * @const
*/
ALL_MATCHING: 0,
/**
* Constant used by getSelectorsForDomain to exclude selectors which apply to
* all websites without exception.
+ * @type {number}
+ * @const
*/
NO_UNCONDITIONAL: 1,
/**
* Constant used by getSelectorsForDomain to return only selectors for filters
* which specifically match the given host name.
+ * @type {number}
+ * @const
*/
SPECIFIC_ONLY: 2,
/**
* Determines from the current filter list which selectors should be applied
* on a particular host name.
* @param {string} domain
* @param {number} [criteria]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld