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)); |