Skip to content

Commit 14ebfbe

Browse files
committed
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`.
1 parent 0402142 commit 14ebfbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

assets/resources/scriptlets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@
549549
const prop = chain.slice(0, pos);
550550
let v = owner[prop];
551551
chain = chain.slice(pos + 1);
552-
if ( v !== undefined ) {
552+
if ( v instanceof Object ) {
553553
makeProxy(v, chain);
554554
return;
555555
}

0 commit comments

Comments
 (0)