1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 11:22:38 +01: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 // Read-only
systemSettings: { systemSettings: {
compiledMagic: 46, // Increase when compiled format changes compiledMagic: 47, // Increase when compiled format changes
selfieMagic: 46, // Increase when selfie format changes selfieMagic: 47, // Increase when selfie format changes
}, },
// https://github.com/uBlockOrigin/uBlock-issues/issues/759#issuecomment-546654501 // https://github.com/uBlockOrigin/uBlock-issues/issues/759#issuecomment-546654501

View File

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