1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

Fix regression in parsing scriptlet arguments

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2557
This commit is contained in:
Raymond Hill 2023-03-24 15:57:48 -04:00
parent 21ccaaf804
commit a42374199e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -2189,7 +2189,7 @@ export class AstFilterParser {
const parentEnd = this.nodes[parent+NODE_END_INDEX];
if ( parentEnd === parentBeg ) { return 0; }
const s = this.getNodeString(parent);
let next = 0, prev = 0;
let next = 0;
// json-based arg?
const match = this.rePatternScriptletJsonArgs.exec(s);
if ( match !== null ) {
@ -2207,7 +2207,9 @@ export class AstFilterParser {
return next;
}
// positional args
const head = this.allocHeadNode();
const argsEnd = s.length;
let prev = head;
let argBodyBeg = 0, argBodyEnd = 0, argEnd = 0;
let t = '';
while ( argBodyBeg < argsEnd ) {
@ -2232,7 +2234,7 @@ export class AstFilterParser {
prev = this.linkRight(prev, next);
}
}
return next;
return this.throwHeadNode(head);
}
indexOfNextScriptletArgSeparator(pattern, beg = 0) {