CSSLint: code cosmetics

This commit is contained in:
tophf 2019-02-13 08:25:53 +03:00
parent 99a7fedfb7
commit 113547b917

View File

@ -259,18 +259,15 @@ var CSSLint = (() => {
let ignoreEnd = null;
let lineno = 0;
let eol = -1;
let m = RX_EMBEDDED.exec(text);
if (!m) return;
let m;
const nextLine = () => {
while ((m = RX_EMBEDDED.exec(text))) {
// account for the lines between the previous and current match
while (eol <= m.index) {
eol = text.indexOf('\n', eol + 1);
if (eol < 0) eol = text.length;
lineno++;
};
do {
// account for the lines between the previous and current match
while (eol <= m.index) nextLine();
}
const ovr = m[1].toLowerCase();
const cmd = ovr.split(':', 1)[0];
@ -314,10 +311,10 @@ var CSSLint = (() => {
ruleset[property.trim()] = mapped === undefined ? 1 : mapped;
});
}
} while ((m = RX_EMBEDDED.exec(text)));
}
// Close remaining ignore block, if any
if (ignoreStart !== null) {
if (ignoreStart) {
ignore.push([ignoreStart, lineno]);
}
}