diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 906e10e5d..d4fd1e07f 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -436,14 +436,15 @@ function setConstantCore( return; } if ( extraArgs.as !== undefined ) { + const value = cValue; if ( extraArgs.as === 'function' ) { - cValue = ( ) => cValue; + cValue = ( ) => value; } else if ( extraArgs.as === 'callback' ) { - cValue = ( ) => (( ) => cValue); + cValue = ( ) => (( ) => value); } else if ( extraArgs.as === 'resolved' ) { - cValue = Promise.resolve(cValue); + cValue = Promise.resolve(value); } else if ( extraArgs.as === 'rejected' ) { - cValue = Promise.reject(cValue); + cValue = Promise.reject(value); } } let aborted = false;