mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Use safe Array.from() in no-xhr-if
scriptlet
Related issue: https://github.com/uBlockOrigin/uAssets/issues/20063
This commit is contained in:
parent
70f247d7f5
commit
17d30343c5
@ -47,6 +47,7 @@ function safeSelf() {
|
|||||||
}
|
}
|
||||||
const self = globalThis;
|
const self = globalThis;
|
||||||
const safe = {
|
const safe = {
|
||||||
|
'Array_from': Array.from,
|
||||||
'Error': self.Error,
|
'Error': self.Error,
|
||||||
'Math_floor': Math.floor,
|
'Math_floor': Math.floor,
|
||||||
'Math_random': Math.random,
|
'Math_random': Math.random,
|
||||||
@ -930,7 +931,7 @@ function matchObjectProperties(propNeedles, ...objs) {
|
|||||||
}
|
}
|
||||||
const safe = safeSelf();
|
const safe = safeSelf();
|
||||||
const haystack = {};
|
const haystack = {};
|
||||||
const props = [ ...propNeedles.keys() ];
|
const props = safe.Array_from(propNeedles.keys());
|
||||||
for ( const obj of objs ) {
|
for ( const obj of objs ) {
|
||||||
if ( obj instanceof Object === false ) { continue; }
|
if ( obj instanceof Object === false ) { continue; }
|
||||||
matchObjectProperties.extractProperties(obj, haystack, props);
|
matchObjectProperties.extractProperties(obj, haystack, props);
|
||||||
|
Loading…
Reference in New Issue
Block a user