Skip to content
Permalink
Browse files
Improve set-constant.js scriptlet
The scriptlet will now still try to trap a specific
property if a segment of the chain is not undefined
while yet not an object either.

For example, this now allows to set a value on
`document.body.onselectstart` when `document.body` has
not been instantiated yet by the browser parser,
whereas this would previously fail because
`document.body` would be `null` while the scriptlet
was testing against `undefined`.
  • Loading branch information
gorhill authored and JustOff committed Jun 14, 2020
1 parent 5079eb4 commit de547cef1b0c9ba513585b1811241abe2db534e3
Showing with 1 addition and 1 deletion.
  1. +1 −1 assets/resources/resources.txt
@@ -1696,7 +1696,7 @@ set-constant.js application/javascript
var prop = chain.slice(0, pos),
v = owner[prop];
chain = chain.slice(pos + 1);
if ( v !== undefined ) {
if ( v instanceof Object ) {
makeProxy(v, chain);
return;
}

0 comments on commit de547ce

Please sign in to comment.