1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Fix regression in set-constant scriptlet

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/947

`Object.prototype` is not an instance of `Object`, but
yet is still a JS object; thus the solution is to
additionally compare against `typeof`.
This commit is contained in:
Raymond Hill 2020-03-16 08:47:34 -04:00
parent ab6fdf43ed
commit 40ea9d69d5
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -549,7 +549,7 @@
const prop = chain.slice(0, pos);
let v = owner[prop];
chain = chain.slice(pos + 1);
if ( v instanceof Object ) {
if ( v instanceof Object || typeof v === 'object' ) {
makeProxy(v, chain);
return;
}