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

Further fix tokenization from regex

As per feedback/discussion:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2368
- https://github.com/uBlockOrigin/uBlock-issues/issues/2367
This commit is contained in:
Raymond Hill 2022-11-17 13:17:32 -05:00
parent 69b899d0f9
commit f46e5ef3b5
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -3043,12 +3043,10 @@ Parser.utils = Parser.prototype.utils = (( ) => {
}
case 4: /* T_GROUP, 'Group' */ {
if (
node.flags.LookAhead === 1 ||
node.flags.NegativeLookAhead === 1 ||
node.flags.LookBehind === 1 ||
node.flags.NegativeLookBehind === 1
) {
return '';
return '\x01';
}
return this.tokenizableStrFromNode(node.val);
}
@ -3156,7 +3154,7 @@ Parser.utils = Parser.prototype.utils = (( ) => {
} catch(ex) {
}
// Process optional sequences
const reOptional = /[\x02\x03]+/g;
const reOptional = /[\x02\x03]+/;
for (;;) {
const match = reOptional.exec(s);
if ( match === null ) { break; }