Fix argument list lookup in trusted-replace-argument scriptlet

This commit is contained in:
Raymond Hill 2024-02-02 12:46:59 -05:00
parent 8c7a33fe90
commit 9b40b2150a
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -4610,7 +4610,7 @@ function trustedReplaceArgument(
? safe.patternToRegex(extraArgs.condition) ? safe.patternToRegex(extraArgs.condition)
: /^/; : /^/;
const reflector = proxyApplyFn(propChain, function(...args) { const reflector = proxyApplyFn(propChain, function(...args) {
const arglist = args.length >= 2 && args[1]; const arglist = args[args.length-1];
if ( Array.isArray(arglist) === false ) { return reflector(...args); } if ( Array.isArray(arglist) === false ) { return reflector(...args); }
const argBefore = arglist[argpos]; const argBefore = arglist[argpos];
if ( reCondition.test(argBefore) === false ) { return reflector(...args); } if ( reCondition.test(argBefore) === false ) { return reflector(...args); }