1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-18 08:52:26 +02:00

Mind implicit prelude * element in pseudo operators

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2355
This commit is contained in:
Raymond Hill 2022-11-10 08:47:54 -05:00
parent b7b53eef14
commit 4d4a5f3807
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1728,12 +1728,14 @@ Parser.prototype.SelectorCompiler = class {
break; break;
case 'ProceduralSelector': case 'ProceduralSelector':
if ( prelude.length !== 0 ) { if ( prelude.length !== 0 ) {
if ( tasks.length === 0 ) { let spath = prelude.join('');
out.selector = prelude.join('');
} else {
tasks.push(this.createSpathTask(prelude.join('')));
}
prelude.length = 0; prelude.length = 0;
if ( spath.endsWith(' ') ) { spath += '*'; }
if ( tasks.length === 0 ) {
out.selector = spath;
} else {
tasks.push(this.createSpathTask(spath));
}
} }
const args = this.compileArgumentAst(data.name, part.args); const args = this.compileArgumentAst(data.name, part.args);
if ( args === undefined ) { return; } if ( args === undefined ) { return; }