From 14ebfbea279c3d949e270a03bab78e02e3e0dac4 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 7 Mar 2020 14:16:54 -0500 Subject: [PATCH] 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`. --- assets/resources/scriptlets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 3d6f5a20597b8..a8900800c617e 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -549,7 +549,7 @@ const prop = chain.slice(0, pos); let v = owner[prop]; chain = chain.slice(pos + 1); - if ( v !== undefined ) { + if ( v instanceof Object ) { makeProxy(v, chain); return; }