Skip to content

Commit c292a90

Browse files
committed
Fix faulty as vararg in set-constant scriptlet
1 parent bd8a91e commit c292a90

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

assets/resources/scriptlets.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,15 @@ function setConstantCore(
436436
return;
437437
}
438438
if ( extraArgs.as !== undefined ) {
439+
const value = cValue;
439440
if ( extraArgs.as === 'function' ) {
440-
cValue = ( ) => cValue;
441+
cValue = ( ) => value;
441442
} else if ( extraArgs.as === 'callback' ) {
442-
cValue = ( ) => (( ) => cValue);
443+
cValue = ( ) => (( ) => value);
443444
} else if ( extraArgs.as === 'resolved' ) {
444-
cValue = Promise.resolve(cValue);
445+
cValue = Promise.resolve(value);
445446
} else if ( extraArgs.as === 'rejected' ) {
446-
cValue = Promise.reject(cValue);
447+
cValue = Promise.reject(value);
447448
}
448449
}
449450
let aborted = false;

0 commit comments

Comments
 (0)