mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
minor code review
This commit is contained in:
parent
229edd6c0e
commit
c49ba60f0b
1 changed files with 11 additions and 14 deletions
|
@ -948,25 +948,19 @@ FilterContainer.prototype.compileProceduralSelector = (function() {
|
||||||
break;
|
break;
|
||||||
case ':has-text':
|
case ':has-text':
|
||||||
value = regexToRawValue.get(task[1]);
|
value = regexToRawValue.get(task[1]);
|
||||||
raw.push(
|
if ( value === undefined ) {
|
||||||
task[0],
|
value = '/' + task[1] + '/';
|
||||||
'(',
|
}
|
||||||
value !== undefined ? value : '/' + task[1] + '/',
|
raw.push(task[0], '(', value, ')');
|
||||||
')'
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case ':matches-css':
|
case ':matches-css':
|
||||||
case ':matches-css-after':
|
case ':matches-css-after':
|
||||||
case ':matches-css-before':
|
case ':matches-css-before':
|
||||||
value = regexToRawValue.get(task[1].value);
|
value = regexToRawValue.get(task[1].value);
|
||||||
raw.push(
|
if ( value === undefined ) {
|
||||||
task[0],
|
value = '/' + task[1].value + '/';
|
||||||
'(',
|
}
|
||||||
task[1].name,
|
raw.push(task[0], '(', task[1].name, ': ', value, ')');
|
||||||
': ',
|
|
||||||
value !== undefined ? value : '/' + task[1].value + '/',
|
|
||||||
')'
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case ':if':
|
case ':if':
|
||||||
case ':if-not':
|
case ':if-not':
|
||||||
|
@ -1033,6 +1027,9 @@ FilterContainer.prototype.compileProceduralSelector = (function() {
|
||||||
var compiled = compile(raw);
|
var compiled = compile(raw);
|
||||||
if ( compiled !== undefined ) {
|
if ( compiled !== undefined ) {
|
||||||
compiled.raw = decompile(compiled);
|
compiled.raw = decompile(compiled);
|
||||||
|
if ( compiled.raw !== raw ) {
|
||||||
|
console.log(raw, '\n', compiled.raw, '\n');
|
||||||
|
}
|
||||||
compiled = JSON.stringify(compiled);
|
compiled = JSON.stringify(compiled);
|
||||||
}
|
}
|
||||||
lastProceduralSelectorCompiled = compiled;
|
lastProceduralSelectorCompiled = compiled;
|
||||||
|
|
Loading…
Reference in a new issue