From 85cf8f5807cf82044970c88d17b112d4994ad5d4 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 16 Mar 2020 09:09:48 -0400 Subject: [PATCH] Fix last commit re. set-constant scriptlet Related commit: - https://github.com/gorhill/uBlock/commit/40ea9d69d5d0 Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/947 Restore intended behavior with original commit: - https://github.com/gorhill/uBlock/commit/14ebfbea279c The purpose of the original change was to be able to trap properties which values were `null`. --- assets/resources/scriptlets.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 47c7399d2..3c934deb2 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -549,7 +549,10 @@ const prop = chain.slice(0, pos); let v = owner[prop]; chain = chain.slice(pos + 1); - if ( v instanceof Object || typeof v === 'object' ) { + if ( + (v instanceof Object) || + (typeof v === 'object' && v !== null) + ) { makeProxy(v, chain); return; }