1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-04 01:59:38 +02:00

Procedural operators without parenthesis are invalid

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2305

Bump up selfie/compile version numbers. Related feedback:
- 85adde9f0c (commitcomment-85569639)
This commit is contained in:
Raymond Hill 2022-10-03 10:47:29 -04:00
parent 2a40e67577
commit e12cd232a0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 14 additions and 9 deletions

View File

@ -175,8 +175,8 @@ const µBlock = { // jshint ignore:line
// Read-only
systemSettings: {
compiledMagic: 46, // Increase when compiled format changes
selfieMagic: 46, // Increase when selfie format changes
compiledMagic: 47, // Increase when compiled format changes
selfieMagic: 47, // Increase when selfie format changes
},
// https://github.com/uBlockOrigin/uBlock-issues/issues/759#issuecomment-546654501

View File

@ -1657,8 +1657,10 @@ Parser.prototype.SelectorCompiler = class {
case 'Selector':
if ( out.length !== 0 ) { out.push(','); }
break;
default:
case 'SelectorList':
break;
default:
return;
}
}
return out.join('');
@ -1697,11 +1699,6 @@ Parser.prototype.SelectorCompiler = class {
case 'TypeSelector':
prelude.push(this.astSerializePart(part));
break;
case 'Selector':
if ( prelude.length !== 0 ) {
prelude.push(', ');
}
break;
case 'ProceduralSelector':
if ( prelude.length !== 0 ) {
if ( tasks.length === 0 ) {
@ -1715,8 +1712,15 @@ Parser.prototype.SelectorCompiler = class {
if ( args === undefined ) { return; }
tasks.push([ data.name, args ]);
break;
default:
case 'Selector':
if ( prelude.length !== 0 ) {
prelude.push(', ');
}
break;
case 'SelectorList':
break;
default:
return;
}
}
if ( tasks.length === 0 && out.action === undefined ) {
@ -1796,6 +1800,7 @@ Parser.prototype.SelectorCompiler = class {
if ( Array.isArray(parts) && parts.length !== 0 ) {
arg = this.astSerialize(parts);
}
if ( arg === undefined ) { return; }
switch ( operator ) {
case 'has-text':
return this.compileText(arg);