mirror of https://github.com/gorhill/uBlock.git
Fix faulty `as` vararg in `set-constant` scriptlet
This commit is contained in:
parent
bd8a91ed3a
commit
c292a90b90
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue