Skip to content

Commit

Permalink
Fix faulty as vararg in set-constant scriptlet
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 16, 2023
1 parent bd8a91e commit c292a90
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c292a90

Please sign in to comment.