1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-23 02:42:41 +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:
Raymond Hill 2022-09-28 09:05:04 -04:00
parent 7379bafb23
commit fe4cfeba2e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1579,12 +1579,12 @@ Parser.prototype.SelectorCompiler = class {
switch ( data.type ) {
case 'AttributeSelector': {
const name = data.name.name;
if ( data.matcher === null ) {
out.push(`[${name}]`);
break;
}
const value = data.value.value || data.value.name;
out.push(
data.matcher
? `[${name}${data.matcher}"${value}"]`
: `[${name}]`
);
out.push(`[${name}${data.matcher}"${value}"]`);
break;
}
case 'ClassSelector':