@@ -485,9 +485,8 @@ builtinScriptlets.push({
485485 'safe-self.fn' ,
486486 ] ,
487487} ) ;
488- function validateConstantFn ( trusted , raw ) {
488+ function validateConstantFn ( trusted , raw , extraArgs = { } ) {
489489 const safe = safeSelf ( ) ;
490- const extraArgs = safe . getExtraArgs ( Array . from ( arguments ) , 2 ) ;
491490 let value ;
492491 if ( raw === 'undefined' ) {
493492 value = undefined ;
@@ -587,7 +586,7 @@ function setConstantFn(
587586 } ;
588587 if ( trappedProp === '' ) { return ; }
589588 const thisScript = document . currentScript ;
590- let normalValue = validateConstantFn ( trusted , rawValue ) ;
589+ let normalValue = validateConstantFn ( trusted , rawValue , extraArgs ) ;
591590 if ( rawValue === 'noopFunc' || rawValue === 'trueFunc' || rawValue === 'falseFunc' ) {
592591 normalValue = cloakFunc ( normalValue ) ;
593592 }
@@ -4772,7 +4771,7 @@ function trustedReplaceArgument(
47724771 const logPrefix = safe . makeLogPrefix ( 'trusted-replace-argument' , propChain , argposRaw , argraw ) ;
47734772 const argpos = parseInt ( argposRaw , 10 ) || 0 ;
47744773 const extraArgs = safe . getExtraArgs ( Array . from ( arguments ) , 3 ) ;
4775- const normalValue = validateConstantFn ( true , argraw ) ;
4774+ const normalValue = validateConstantFn ( true , argraw , extraArgs ) ;
47764775 const reCondition = extraArgs . condition
47774776 ? safe . patternToRegex ( extraArgs . condition )
47784777 : / ^ / ;
0 commit comments