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

Unified Diff: lib/filterClasses.js

Issue 29550667: Noissue - rename variable 'ret' to more meaningful 'filter' in lib/filterClasses.js (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git
Patch Set: Created Sept. 20, 2017, 1:09 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/filterClasses.js
diff --git a/lib/filterClasses.js b/lib/filterClasses.js
index ec7d3d7067494ce7d630844ed57edd194b4641f9..24c18d46761ae29e4ffa468835a1c8d9595f68fb 100644
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -108,9 +108,9 @@ Filter.optionsRegExp = /\$(~?[\w-]+(?:=[^,\s]+)?(?:,~?[\w-]+(?:=[^,\s]+)?)*)$/;
*/
Filter.fromText = function(text)
{
- let ret = Filter.knownFilters.get(text);
- if (ret)
- return ret;
+ let filter = Filter.knownFilters.get(text);
+ if (filter)
+ return filter;
let match = (text.includes("#") ? Filter.elemhideRegExp.exec(text) : null);
if (match)
@@ -127,17 +127,17 @@ Filter.fromText = function(text)
`${prefix}:-abp-properties(${expression})${suffix}`);
}
- ret = ElemHideBase.fromText(
+ filter = ElemHideBase.fromText(
text, match[1], match[2], match[3]
);
}
else if (text[0] == "!")
- ret = new CommentFilter(text);
+ filter = new CommentFilter(text);
else
- ret = RegExpFilter.fromText(text);
+ filter = RegExpFilter.fromText(text);
- Filter.knownFilters.set(ret.text, ret);
- return ret;
+ Filter.knownFilters.set(filter.text, filter);
+ return filter;
};
/**
@@ -148,17 +148,17 @@ Filter.fromText = function(text)
*/
Filter.fromObject = function(obj)
{
- let ret = Filter.fromText(obj.text);
- if (ret instanceof ActiveFilter)
+ let filter = Filter.fromText(obj.text);
+ if (filter instanceof ActiveFilter)
{
if ("disabled" in obj)
- ret._disabled = (obj.disabled == "true");
+ filter._disabled = (obj.disabled == "true");
if ("hitCount" in obj)
- ret._hitCount = parseInt(obj.hitCount, 10) || 0;
+ filter._hitCount = parseInt(obj.hitCount, 10) || 0;
if ("lastHit" in obj)
- ret._lastHit = parseInt(obj.lastHit, 10) || 0;
+ filter._lastHit = parseInt(obj.lastHit, 10) || 0;
}
- return ret;
+ return filter;
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld