From 7dd98258e98af933aa9b0e8285fcfbea5831dfdf Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 9 Nov 2023 19:57:51 -0500 Subject: [PATCH] Add `stackToMatch` vararg to `trusted-prune-inbound-object.js` As discussed with filter list maintainers. --- assets/resources/scriptlets.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index ae1c0635a..d290030a0 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -4123,6 +4123,7 @@ function trustedPruneInboundObject( if ( rawNeedlePaths !== '' ) { needlePaths.push(...rawNeedlePaths.split(/ +/)); } + const stackNeedle = safe.initPattern(extraArgs.stackToMatch || '', { canNegate: true }); const mustProcess = root => { for ( const needlePath of needlePaths ) { if ( objectFindOwnerFn(root, needlePath) === false ) { @@ -4150,7 +4151,7 @@ function trustedPruneInboundObject( objBefore, rawPrunePaths, rawNeedlePaths, - { matchAll: true }, + stackNeedle, extraArgs ); args[argIndex-1] = objAfter || objBefore;