Improve reliability of set-constant scriptlet

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1694
This commit is contained in:
Raymond Hill 2021-08-25 10:48:50 -04:00
parent 7ee9c21b37
commit a21ecafbc6
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 3 additions and 1 deletions

View File

@ -924,7 +924,9 @@
const odesc = Object.getOwnPropertyDescriptor(owner, prop);
let prevGetter, prevSetter;
if ( odesc instanceof Object ) {
if ( odesc.configurable === false ) { return; }
if ( odesc.configurable === false ) {
owner[prop] = cValue;
}
if ( odesc.get instanceof Function ) {
prevGetter = odesc.get;
}