Fix faulty `as` vararg in `set-constant` scriptlet · gorhill/uBlock@c292a90 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
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

Lines changed: 5 additions & 4 deletions
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)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.