mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-23 10:52:43 +01:00
Code review re. attribute serializer
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2300
Related commit:
- 7379bafb23
This commit is contained in:
parent
7379bafb23
commit
fe4cfeba2e
@ -1579,12 +1579,12 @@ Parser.prototype.SelectorCompiler = class {
|
|||||||
switch ( data.type ) {
|
switch ( data.type ) {
|
||||||
case 'AttributeSelector': {
|
case 'AttributeSelector': {
|
||||||
const name = data.name.name;
|
const name = data.name.name;
|
||||||
|
if ( data.matcher === null ) {
|
||||||
|
out.push(`[${name}]`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
const value = data.value.value || data.value.name;
|
const value = data.value.value || data.value.name;
|
||||||
out.push(
|
out.push(`[${name}${data.matcher}"${value}"]`);
|
||||||
data.matcher
|
|
||||||
? `[${name}${data.matcher}"${value}"]`
|
|
||||||
: `[${name}]`
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'ClassSelector':
|
case 'ClassSelector':
|
||||||
|
Loading…
Reference in New Issue
Block a user