Use already available stringified character code

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2372
This commit is contained in:
Raymond Hill 2022-11-18 10:10:47 -05:00
parent 04b8d495b6
commit 42a7cfced3
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 1 deletions

View File

@ -3061,7 +3061,8 @@ Parser.utils = Parser.prototype.utils = (( ) => {
return String.fromCharCode(first+2, last+2);
}
case 64: /* T_HEXCHAR, 'HexChar' */ {
return String.fromCharCode(parseInt(node.val.slice(1), 16));
if ( node.flags.Code === '01' ) { return '\x00'; }
return node.flags.Char;
}
case 128: /* T_SPECIAL, 'Special' */ {
const flags = node.flags;