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;
|
return;
|
||||||
}
|
}
|
||||||
if ( extraArgs.as !== undefined ) {
|
if ( extraArgs.as !== undefined ) {
|
||||||
|
const value = cValue;
|
||||||
if ( extraArgs.as === 'function' ) {
|
if ( extraArgs.as === 'function' ) {
|
||||||
cValue = ( ) => cValue;
|
cValue = ( ) => value;
|
||||||
} else if ( extraArgs.as === 'callback' ) {
|
} else if ( extraArgs.as === 'callback' ) {
|
||||||
cValue = ( ) => (( ) => cValue);
|
cValue = ( ) => (( ) => value);
|
||||||
} else if ( extraArgs.as === 'resolved' ) {
|
} else if ( extraArgs.as === 'resolved' ) {
|
||||||
cValue = Promise.resolve(cValue);
|
cValue = Promise.resolve(value);
|
||||||
} else if ( extraArgs.as === 'rejected' ) {
|
} else if ( extraArgs.as === 'rejected' ) {
|
||||||
cValue = Promise.reject(cValue);
|
cValue = Promise.reject(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let aborted = false;
|
let aborted = false;
|
||||||
|
|
Loading…
Reference in New Issue