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

Unified Diff: lib/common.js

Issue 29807560: Issue 6745 - Prefer strict equality operator (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 14, 2018, 4:11 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 | lib/content/elemHideEmulation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/common.js
===================================================================
--- a/lib/common.js
+++ b/lib/common.js
@@ -71,29 +71,29 @@
let start = 0;
let level = 0;
let sep = "";
for (let i = 0; i < selector.length; i++)
{
let chr = selector[i];
- if (chr == "\\") // ignore escaped characters
+ if (chr === "\\") // ignore escaped characters
i++;
- else if (chr == sep) // don't split within quoted text
- sep = ""; // e.g. [attr=","]
- else if (sep == "")
+ else if (chr === sep) // don't split within quoted text
+ sep = ""; // e.g. [attr=","]
+ else if (sep === "")
{
- if (chr == '"' || chr == "'")
+ if (chr === '"' || chr === "'")
sep = chr;
- else if (chr == "(") // don't split between parentheses
- level++; // e.g. :matches(div,span)
- else if (chr == ")")
+ else if (chr === "(") // don't split between parentheses
+ level++; // e.g. :matches(div,span)
+ else if (chr === ")")
level = Math.max(0, level - 1);
- else if (chr == "," && level == 0)
+ else if (chr === "," && level === 0)
{
selectors.push(selector.substring(start, i));
start = i + 1;
}
}
}
selectors.push(selector.substring(start));
« no previous file with comments | « no previous file | lib/content/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld