1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-26 12:22:50 +01:00

Catch exceptions thrown Object.defineProperty

Related issue:
- https://github.com/uBlockOrigin/uAssets/issues/9883

Related commit:
- a9e6f9c72c
This commit is contained in:
Raymond Hill 2021-09-01 18:25:20 -04:00
parent 79a2678f00
commit 5dd91211ae
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -932,21 +932,24 @@
prevSetter = odesc.set;
}
}
Object.defineProperty(owner, prop, {
configurable,
get() {
if ( prevGetter !== undefined ) {
prevGetter();
try {
Object.defineProperty(owner, prop, {
configurable,
get() {
if ( prevGetter !== undefined ) {
prevGetter();
}
return handler.getter(); // cValue
},
set(a) {
if ( prevSetter !== undefined ) {
prevSetter(a);
}
handler.setter(a);
}
return handler.getter(); // cValue
},
set(a) {
if ( prevSetter !== undefined ) {
prevSetter(a);
}
handler.setter(a);
}
});
});
} catch(ex) {
}
};
const trapChain = function(owner, chain) {
const pos = chain.indexOf('.');