1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-21 18:02:34 +01:00

Minor code review

This commit is contained in:
Raymond Hill 2024-11-16 09:54:19 -05:00
parent 442331136c
commit 51edb13a06
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -51,14 +51,13 @@ export function spoofCSS(
const privatePropToValueMap = new Map();
for ( let i = 0; i < args.length; i += 2 ) {
const prop = toCamelCase(args[i+0]);
if ( typeof prop !== 'string' ) { break; }
if ( prop === '' ) { break; }
const value = args[i+1];
if ( typeof value !== 'string' ) { break; }
if ( prop.charCodeAt(0) === 0x5F /* _ */ ) {
privatePropToValueMap.set(prop, value);
} else {
propToValueMap.set(toCamelCase(prop), value);
propToValueMap.set(prop, value);
}
}
const safe = safeSelf();