Skip to content

Commit

Permalink
Fix regression in set-constant scriptlet
Browse files Browse the repository at this point in the history
Related issue:
- uBlockOrigin/uBlock-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`.
  • Loading branch information
gorhill committed Mar 16, 2020
1 parent ab6fdf4 commit 40ea9d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/resources/scriptlets.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit 40ea9d6

Please sign in to comment.